#1 Le 27/10/2020, à 14:27
- johnnybee
[RESOLU] preseed ubiquity injection configuration dans un fichier
Salut,
J'essaie d'injecter une configuration dans un fichier .conf avec une directive ubiquity success_command en post installation d'Ubuntu
Dans mon fichier de présélection, j'utilise ubiquity success_command. (l'ancien d-i preseed/late_command n'est pas compatible avec l'installeur Ubiquity)
ubiquity ubiquity/success_command string \
in-target apt update -y; \
in-target apt upgrade -y; \
in-target wget -P /tmp/ https://apt.puppetlabs.com/puppet6-release-focal.deb; \
in-target dpkg -i /tmp/puppet6-release-focal.deb; \
in-target apt update -y; \
in-target apt install -y puppet-agent; \
> WORKS
in-target /bin/sh -c 'echo "[main]" | tee -a /target/etc/puppetlabs/puppet/puppet.conf'; \
in-target /bin/sh -c 'echo "certname = $HOSTNAME" | tee -a /target/etc/puppetlabs/puppet/puppet.conf'; \
in-target /bin/sh -c 'echo "server = server.example.com" | tee -a /target/etc/puppetlabs/puppet/puppet.conf';
> DOES NOT WORK
in-target echo -e "[main]\ncertname = $HOSTNAME\nserver = server.example.com\nenvironment = production\nruninterval = 15m" >> /target/etc/puppetlabs/puppet/puppet.conf ;
> DOES NOT WORK
Si je teste manuellement dans un simple terminalle fichier est bien alimenté
Avez-vous le même comportement ?
Ubuntu 20.04 LTS amd64 Live installer avec Ubiquity
Merci pour votre aide
Dernière modification par johnnybee (Le 28/10/2020, à 10:44)
Hors ligne
#3 Le 28/10/2020, à 10:43
- johnnybee
Re : [RESOLU] preseed ubiquity injection configuration dans un fichier
Update :
Via un script bash en post installation ça fonctionne. L'installeur ubiquity interprète vraiment mal les string en ubiquity/success_command dans le preseed
Preseed + Ubiquity est à proscrire...............
Dernière modification par johnnybee (Le 28/10/2020, à 14:38)
Hors ligne