From a5a85db110bc4840b9806773b4b6e79298117ce4 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Sat, 16 Mar 2013 01:00:53 +0100 Subject: [PATCH] Ajout : vm_hosted : utilise debconf-set-selections . --- TODO | 1 + vm_hosted | 42 ++++++++++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/TODO b/TODO index 9991442..84a3468 100644 --- 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 diff --git a/vm_hosted b/vm_hosted index f1670ba..1ffd176 100755 --- 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 -- 2.20.1