Ajout : vm_hosted : utilise debconf-set-selections .
authorJulien Moutinho <julm+burette@autogeree.net>
Sat, 16 Mar 2013 00:00:53 +0000 (01:00 +0100)
committerJulien Moutinho <julm+burette@autogeree.net>
Tue, 19 Mar 2013 09:42:05 +0000 (10:42 +0100)
TODO
vm_hosted

diff --git a/TODO b/TODO
index 9991442..84a3468 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,3 +3,4 @@
 - script de grenode/gresille pour les oublis de commit dans etc ...
 - voir xoe: http://sisalp.fr/index.php/post/Installation-OpenERP-procedure-totalement-automatisee-d-installation-de-xoe-et-d-OpenERP
 - avertir présences autres admins
+- aptitude-create-state-bundle
index f1670ba..1ffd176 100755 (executable)
--- a/vm_hosted
+++ b/vm_hosted
@@ -46,7 +46,10 @@ rule_git_reset () {
  }
 
 rule_apt_get_install () { # SYNTAX: $package
-       sudo apt-get install "$@"
+       sudo DEBIAN_FRONTEND=noninteractive apt-get install "$@"
+ }
+rule_dpkg_reconfigure () { # SYNTAX: $package
+       sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure "$@"
  }
 
 rule__chrooted_configure () { # NOTE: est-ce bien utile à un moment ?
@@ -268,7 +271,10 @@ rule_apt_configure () {
                EOF
  }
 rule_boot_configure () {
-       warn "lors de l'installation Debian, surtout n'installer GRUB sur AUCUN disque proposé !"
+       #warn "lors de l'installation Debian, surtout n'installer GRUB sur AUCUN disque proposé !"
+       sudo debconf-set-selections <<-EOF
+               grub-pc grub-pc/install_devices multiselect     
+               EOF
        rule apt_get_install grub-pc
        sudo install -d -m 644 -o root -g root /boot/grub
        rule apt_get_install linux-image-$vm_arch
@@ -487,18 +493,12 @@ rule_initramfs_configure () {
         # NOTE: clefs générées par Debian
        sudo update-initramfs -u
  }
-rule_time_configure () {
-       sudo install -m 644 -o root -g root /dev/stdin /etc/timezone <<-EOF
-               Europe/Paris
-               EOF
-       sudo dpkg-reconfigure tzdata
-       rule apt_get_install ntp
- }
 rule_locale_configure () {
-       sudo install -m 644 -o root -g root /dev/stdin /etc/locale.gen <<-EOF
-               fr_FR.UTF-8 UTF-8
+       sudo debconf-set-selections <<-EOF
+               locales locales/default_environment_locale      select  None
+               locales locales/locales_to_be_generated multiselect     fr_FR.UTF-8 UTF-8
                EOF
-       sudo update-locale
+       rule dpkg_reconfigure locales
  }
 rule_login_configure () {
        sudo install -m 644 -o root -g root /dev/stdin /etc/inittab <<-EOF
@@ -871,7 +871,10 @@ rule_php5_fpm_configure () {
 rule_postfix_configure () {
        local hint="run vm_remote postfix_key_send before"
        assert "test -f /etc/postfix/$vm_domainname/smtpd/x509/key.pem" hint
-       warn "lors de l'installation Debian, ne sélectionner aucune configuration pour postfix"
+       #warn "lors de l'installation Debian, ne sélectionner aucune configuration pour postfix"
+       sudo debconf-set-selections <<-EOF
+               postfix postfix/main_mailer_type        select  No configuration
+               EOF
        rule apt_get_install postfix
        sudo install -m 640 -o root -g root /dev/stdin /etc/postfix/.gitignore <<-EOF
                *.db
@@ -1034,10 +1037,21 @@ rule_sysctl_configure () {
         do conf=${conf#"$tool"/etc/sysctl.d/}
                sudo install -m 660 -o root -g root \
                 "$tool"/etc/sysctl.d/"$conf" \
-                /etc/sysctl.d/"$conf"
+                       /etc/sysctl.d/"$conf"
         done
        sudo sysctl --system
  }
+rule_time_configure () {
+       sudo install -m 644 -o root -g root /dev/stdin /etc/timezone <<-EOF
+               Europe/Paris
+               EOF
+       sudo debconf-set-selections <<-EOF
+               tzdata  tzdata/Areas    select  Europe
+               tzdata  tzdata/Zones/Europe     select  Paris
+               EOF
+       rule dpkg_reconfigure tzdata
+       rule apt_get_install ntp
+ }
 rule_user_add () { # SYNTAX: $user
        rule user_configure
        local user=$1