2 #sudo apt-get install sudo git
3 #sudo apt-get install emacs-nox tmux
6 printf >&2 '%s: must be run as root\n' "$0"
11 if ! [[ -x /usr/bin/puppet ]]; then
13 apt-get install -y puppet puppet-master
16 if ! [[ -h /etc/puppet/code/modules ]]; then
17 ln -s $PWD/modules /etc/puppet/code/modules
18 ln -s $PWD/environments /etc/puppet/code/environments
20 if grep -q "^search\|^domain" /etc/resolv.conf; then
21 echo "Removing domain from resolv.conf"
22 sed -i "/^search\|^domain/d" /etc/resolv.conf
23 systemctl restart puppet-master
26 if ! grep -q host01 /etc/hosts; then
27 echo "Changing hostname"
28 hostnamectl set-hostname host01
29 echo "127.0.0.1 host01" >> /etc/hosts
30 systemctl restart puppet-master
31 echo "Please open a new shell (hostname) and restart bootstrap"
36 # In version 4.19 and 4.20, the "file_line" is not able to remove "search" and "domain" lines from the container's resolv.conf.
37 # Since Puppet 4 does not support "union ranges" of versions (only Puppet 5 does, which is currently not included in Debian), require >=4.21.0 and ignore that <=4.18 works as well.
38 # <5 is required for puppetlabs-postgresql v4: https://forge.puppet.com/puppetlabs/postgresql/4.9.0/dependencies
39 # installing a newer stdlib causes postgresql-v4 fail installation.
40 puppet module install puppetlabs-stdlib --version ">=4.21.0 <5.0.0"
41 puppet module install puppetlabs-firewall --version 1
42 puppet module install puppetlabs-apt --version 2
43 puppet module install puppetlabs-postgresql --version 4
44 puppet module install puppetlabs-mysql --version 3
46 puppet apply /etc/puppet/code/environments/production/manifests --debug