(
cd "$tool"
git config --replace branch.master.remote .
git config --replace branch.master.merge refs/remotes/master
(
cd "$tool"
git config --replace branch.master.remote .
git config --replace branch.master.merge refs/remotes/master
- case $(dpkg -s "$1" 2>/dev/null | grep '^Status: ') in
- ("Status: install ok installed");;
- (*)
- test ! -x /usr/bin/etckeeper ||
- ! sudo etckeeper unclean ||
- warn "/etc unclean: etckeeper may force you to \`etckeeper commit'; then you can run your $0 command again."
- sudo apt-get install "$@";;
- esac
+ sudo apt-get install "$@"
rule_boot_configure () {
warn "lors de l'installation Debian, surtout n'installer GRUB sur AUCUN disque proposé !"
rule apt_get_install grub-pc
rule_boot_configure () {
warn "lors de l'installation Debian, surtout n'installer GRUB sur AUCUN disque proposé !"
rule apt_get_install grub-pc
# <file system> <mount point> <type> <options> <dump> <pass>
LABEL=${vm_lvm_lv}_boot /boot ext2 defaults 0 0
proc /proc proc defaults 0 0
# <file system> <mount point> <type> <options> <dump> <pass>
LABEL=${vm_lvm_lv}_boot /boot ext2 defaults 0 0
proc /proc proc defaults 0 0
# NOTE: barrier=1 réduit drastiquement les performances d'écriture, mais garantit la cohérence du système de fichiers.
/dev/mapper/${vm_lvm_lv}_swap_deciphered swap swap sw 0 0
EOF
# NOTE: barrier=1 réduit drastiquement les performances d'écriture, mais garantit la cohérence du système de fichiers.
/dev/mapper/${vm_lvm_lv}_swap_deciphered swap swap sw 0 0
EOF
# <target name> <source device> <key file> <options>
${vm_lvm_lv}_root_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_root none luks,lvm=$vm_lvm_vg
${vm_lvm_lv}_var_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_var ${vm_lvm_lv}_root_deciphered luks,lvm=$vm_lvm_vg,keyscript=/lib/cryptsetup/scripts/decrypt_derived
${vm_lvm_lv}_home_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_home ${vm_lvm_lv}_root_deciphered luks,lvm=$vm_lvm_vg,keyscript=/lib/cryptsetup/scripts/decrypt_derived
${vm_lvm_lv}_swap_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_swap ${vm_lvm_lv}_root_deciphered luks,lvm=$vm_lvm_vg,keyscript=/lib/cryptsetup/scripts/decrypt_derived
EOF
# <target name> <source device> <key file> <options>
${vm_lvm_lv}_root_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_root none luks,lvm=$vm_lvm_vg
${vm_lvm_lv}_var_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_var ${vm_lvm_lv}_root_deciphered luks,lvm=$vm_lvm_vg,keyscript=/lib/cryptsetup/scripts/decrypt_derived
${vm_lvm_lv}_home_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_home ${vm_lvm_lv}_root_deciphered luks,lvm=$vm_lvm_vg,keyscript=/lib/cryptsetup/scripts/decrypt_derived
${vm_lvm_lv}_swap_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_swap ${vm_lvm_lv}_root_deciphered luks,lvm=$vm_lvm_vg,keyscript=/lib/cryptsetup/scripts/decrypt_derived
EOF
vm.swappiness = 10 # NOTE: n'utilise le swap qu'en cas d'absolue nécessité
vm.vfs_cache_pressure=50
EOF
}
rule_initramfs_configure () {
vm.swappiness = 10 # NOTE: n'utilise le swap qu'en cas d'absolue nécessité
vm.vfs_cache_pressure=50
EOF
}
rule_initramfs_configure () {
EOF
sudo sed -e '/^configure_networking /s/ &$//' \
-i /usr/share/initramfs-tools/scripts/init-premount/dropbear
EOF
sudo sed -e '/^configure_networking /s/ &$//' \
-i /usr/share/initramfs-tools/scripts/init-premount/dropbear
/etc/initramfs-tools/etc/dropbear/dropbear_rsa_host_key
}
# NOTE: ne se préoccupe pas de dropbear_dss_host_key ; Debian la génère et l'utilise néamoins.
/etc/initramfs-tools/etc/dropbear/dropbear_rsa_host_key
}
# NOTE: ne se préoccupe pas de dropbear_dss_host_key ; Debian la génère et l'utilise néamoins.
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"
rule apt_get_install postfix
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"
rule apt_get_install postfix
sudo install -d -m 770 -o root -g root \
/etc/postfix/$vm_domainname/ \
/etc/postfix/$vm_domainname/smtp \
sudo install -d -m 770 -o root -g root \
/etc/postfix/$vm_domainname/ \
/etc/postfix/$vm_domainname/smtp \
../crt+crl.self-signed.pem \
/etc/postfix/$vm_domainname/smtpd/x509/ca/crt.pem
sudo install -m 400 -o root -g root \
../crt+crl.self-signed.pem \
/etc/postfix/$vm_domainname/smtpd/x509/ca/crt.pem
sudo install -m 400 -o root -g root \
- etc/postfix/$vm_domainname/smtp/header_checks \
- /etc/postfix/$vm_domainname/smtp/header_checks
+ "$tool"/etc/postfix/$vm_domainname/smtp/header_checks \
+ /etc/postfix/$vm_domainname/smtp/header_checks
- etc/postfix/$vm_domainname/smtpd/sender_access \
- /etc/postfix/$vm_domainname/smtpd/sender_access
+ "$tool"/etc/postfix/$vm_domainname/smtpd/sender_access \
+ /etc/postfix/$vm_domainname/smtpd/sender_access
sudo postmap hash:/etc/postfix/$vm_domainname/smtpd/sender_access
sudo install -m 660 -o root -g root \
sudo postmap hash:/etc/postfix/$vm_domainname/smtpd/sender_access
sudo install -m 660 -o root -g root \
- etc/postfix/$vm_domainname/smtpd/client_blacklist \
- /etc/postfix/$vm_domainname/smtpd/client_blacklist
+ "$tool"/etc/postfix/$vm_domainname/smtpd/client_blacklist \
+ /etc/postfix/$vm_domainname/smtpd/client_blacklist
sudo postmap hash:/etc/postfix/$vm_domainname/smtpd/client_blacklist
sudo install -m 660 -o root -g root \
sudo postmap hash:/etc/postfix/$vm_domainname/smtpd/client_blacklist
sudo install -m 660 -o root -g root \
- etc/postfix/$vm_domainname/smtpd/relay_clientcerts \
- /etc/postfix/$vm_domainname/smtpd/relay_clientcerts
+ "$tool"/etc/postfix/$vm_domainname/smtpd/relay_clientcerts \
+ /etc/postfix/$vm_domainname/smtpd/relay_clientcerts
sudo postmap hash:/etc/postfix/$vm_domainname/smtpd/relay_clientcerts
sudo install -m 660 -o root -g root \
sudo postmap hash:/etc/postfix/$vm_domainname/smtpd/relay_clientcerts
sudo install -m 660 -o root -g root \
-rule_user_configure () {
- sudo install -d -m 750 -u root -g adm \
- /etc/skel/etc \
- /etc/skel/etc/ssh
- sudo install -d -m 770 -u root -g adm \
- /etc/skel/etc/apache2 \
- /etc/skel/var \
- /etc/skel/var/log \
- /etc/skel/var/cache \
- /etc/skel/var/cache/ssh
- sudo ln -fns etc/ssh /etc/skel/.ssh
- sudo ln -fns etc/gpg /etc/skel/.gnupg
ssh-keygen -F "$vm_fqdn" -f "$tool"/etc/openssh/known_hosts |
( while IFS= read -r line
do case $line in (*" RSA") return 0; break;; esac
ssh-keygen -F "$vm_fqdn" -f "$tool"/etc/openssh/known_hosts |
( while IFS= read -r line
do case $line in (*" RSA") return 0; break;; esac
/etc/ssh/ssh_host_ecdsa_key \
/etc/ssh/ssh_host_ecdsa_key.pub
# NOTE: clefs générées par Debian
/etc/ssh/ssh_host_ecdsa_key \
/etc/ssh/ssh_host_ecdsa_key.pub
# NOTE: clefs générées par Debian
case \$(/usr/bin/passwd --status "\$SUDO_USER") in \\
("\$SUDO_USER L "*) /usr/bin/passwd \$SUDO_USER;; esac
EOF
case \$(/usr/bin/passwd --status "\$SUDO_USER") in \\
("\$SUDO_USER L "*) /usr/bin/passwd \$SUDO_USER;; esac
EOF
sudo /bin/sh -e -f -u -c \
'case \$(/usr/bin/passwd --status "\$SUDO_USER") in ("\$SUDO_USER L "*) /usr/bin/passwd \$SUDO_USER;; esac'
EOF
sudo /bin/sh -e -f -u -c \
'case \$(/usr/bin/passwd --status "\$SUDO_USER") in ("\$SUDO_USER L "*) /usr/bin/passwd \$SUDO_USER;; esac'
EOF
local key; local -; set +f
for key in "$tool"/var/pub/openpgp/*.key
do sudo gpg --import "$key"
done
}
local key; local -; set +f
for key in "$tool"/var/pub/openpgp/*.key
do sudo gpg --import "$key"
done
}