X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=vm_hosted;h=1ffd17654001188654ccc4cb84589633e9515b1e;hp=f1670ba1dfa1f861804539c2e6e65aaec48fcec0;hb=a5a85db110bc4840b9806773b4b6e79298117ce4;hpb=ee0303a5c9eda65949857d0d192c5910cd41f1e2 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