Project

General

Profile

Download (1.74 KB) Statistics
| Branch: | Tag: | Revision:
82511609 Lukas Zapletal
#cloud-config
749e7f2d Lukas Zapletal
hostname: snapshot-ipv4-dhcp-ubuntu18
fqdn: snapshot-ipv4-dhcp-ubuntu18
82511609 Lukas Zapletal
manage_etc_hosts: true
users: {}
runcmd:
- |
echo "" > /etc/hostname
hostname
cat > /etc/hosts << EOF
749e7f2d Lukas Zapletal
127.0.0.1 snapshot-ipv4-dhcp-ubuntu18 localhost localhost.localdomain
82511609 Lukas Zapletal
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF
- |
- |
echo "Updating system time"
systemctl enable --now chronyd
/usr/bin/chronyc -a makestep
/usr/sbin/hwclock --systohc
- |

- |
echo "blacklist amodule" >> /etc/modprobe.d/blacklist.conf

- |
apt-get update
117b53a9 Adam Cécile
apt-get install -y puppet
82511609 Lukas Zapletal
117b53a9 Adam Cécile
cat > /etc/puppet/puppet.conf << EOF
82511609 Lukas Zapletal
[main]
117b53a9 Adam Cécile
vardir = /var/lib/puppet
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = \$vardir/ssl
82511609 Lukas Zapletal
[agent]
pluginsync = true
report = true
749e7f2d Lukas Zapletal
certname = snapshot-ipv4-dhcp-ubuntu18
82511609 Lukas Zapletal
EOF
117b53a9 Adam Cécile
if [ -f "/etc/default/puppet" ]
then
/bin/sed -i 's/^START=no/START=yes/' /etc/default/puppet
fi
/usr/bin/puppet agent --enable
82511609 Lukas Zapletal
# export a custom fact called 'is_installer' to allow detection of the installer environment in Puppet modules
export FACTER_is_installer=true
# passing a non-existent tag like "no_such_tag" to the puppet agent only initializes the node
06600bcc Pat Riehecky
# You can select specific tag(s) with the "run-puppet-in-installer-tags" parameter
# or set a full puppet run by setting "run-puppet-in-installer" = true
echo "Performing initial puppet run for --tags no_such_tag"
117b53a9 Adam Cécile
/usr/bin/puppet agent --config /etc/puppet/puppet.conf --onetime --tags no_such_tag --no-daemonize
82511609 Lukas Zapletal
systemctl enable puppet
8d64e386 Trent Anderson
82511609 Lukas Zapletal
phone_home:
0ed80f45 Ondřej Ezr
url: http://foreman.example.com/unattended/built
82511609 Lukas Zapletal
post: []
tries: 10