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 puppet module install puppetlabs-firewall --version 1
37 # pinned to 4.18, as from version 4.19 the "file_line" is not able to remove "search" and "domain" lines from the container's resolv.conf
38 puppet module install puppetlabs-stdlib --version 4.18
39 puppet module install puppetlabs-apt --version 2
40 puppet module install puppetlabs-postgresql --version 4
41 puppet module install puppetlabs-mysql --version 3
43 puppet apply /etc/puppet/code/environments/production/manifests --debug