The Foreman Installation Script
|The Foreman gives Puppet a webgui interface, which is nice for daily routines.
To get you kickstarted real quick I wrote a straight forward bash script which has the documentation to get you going as well.
Good luck!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
#!/bin/bash # puppet with TheForeman for ubuntu 14.04 LTS server # use default hostname: ubuntu, when installing your ubuntu server # when using a VM connect first with SSH so you can copy the code # easier into a shell script (install.sh) # HOWEVER, after that execute the script from the VM console # cause otherwise you'll loose connection after the IP had been changed! # Furthermore change the IP in the code to your needs # and you should be ready to go # # Feedback at Twitter @henrydenhengst # sudo apt-get update -y && sudo apt-get upgrade -y # # Edit /etc/network/interfaces to meet your requirements. # sudo sed -i 's!dhcp!static!g' /etc/network/interfaces sudo sed -i '$ a\address 192.168.1.2' /etc/network/interfaces sudo sed -i '$ a\netmask 255.255.255.0' /etc/network/interfaces sudo sed -i '$ a\network 192.168.1.0' /etc/network/interfaces sudo sed -i '$ a\broadcast 192.168.1.255' /etc/network/interfaces sudo sed -i '$ a\gateway 192.168.1.1' /etc/network/interfaces # # Name resolution: Every node must have a unique hostname. # Forward and reverse DNS must both be configured correctly. # (If your site lacks DNS, you must write an /etc/hosts file on each node.) # Your agent nodes can be ready sooner if this hostname resolves to your puppet master. sudo sed -i '$ a\dns-nameservers 192.168.1.1' /etc/network/interfaces # # restart network sudo service networking restart # # change hostname sudo hostname foreman # # To change the name permanently, run command to edit the host files: sudo sed -i 's/ubuntu/foreman/g' /etc/hosts sudo sed -i 's/127.0.1.1/# 127.0.1.1/g' /etc/hosts sudo sed -i '$ a\192.168.1.2 foreman.test.local foreman' /etc/hosts sudo sed -i 's/ubuntu/foreman/g' /etc/hostname # sudo apt-get install ntp -y # # Puppet # # Puppet is a cross platform framework enabling system administrators to perform common tasks using code. The code can do a variety of tasks from installing new software, to checking file permissions, or updating user accounts. Puppet is great not only during the initial installation of a system, but also throughout the system's entire life cycle. In most circumstances puppet will be used in a client/server configuration. # # Install Puppet and The Foreman # wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb dpkg -i puppetlabs-release-trusty.deb -y # sudo bash -c 'echo "deb http://deb.theforeman.org/ trusty 1.6" > /etc/apt/sources.list.d/foreman.list' sudo bash -c 'echo "deb http://deb.theforeman.org/ plugins 1.6" >> /etc/apt/sources.list.d/foreman.list' wget -q http://deb.theforeman.org/pubkey.gpg -O- | sudo apt-key add - # sudo apt-get update && apt-get install foreman-installer # sudo foreman-installer # sudo puppet agent --test # # configuratie firewall (ip4+ip6) https://help.ubuntu.com/14.04/serverguide/firewall.html sudo ufw enable sudo ufw logging on sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw allow 53 sudo ufw allow 67/udp sudo ufw allow 68/udp sudo ufw allow 69/udp sudo ufw allow 3000/tcp sudo ufw allow 3306/tcp sudo ufw allow 5910:5930/tcp sudo ufw allow 5432/tcp sudo ufw allow 8140/tcp sudo ufw allow 8443/tcp # # sudo reboot |
Share = Care
One Comment
There is the excellent foreman-installer[0] that leverages puppet for automating the installation of foreman and the tooling around it as well. It supports a bunch of operating systems 🙂
[0] http://theforeman.org/manuals/1.6/index.html#3.InstallingForeman