henrydenhengst

The Foreman 1.9 on Ubuntu 14.04 LTS

Nov 16th, 2015
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.57 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Script must be run as root !!!
  4. #
  5. # Check root privileges
  6. if [[ $EUID -ne 0 ]]; then
  7.    echo "This script must be run as root"
  8.    exit 1
  9. fi
  10. #
  11. # change hostname
  12. hostname puppet
  13. #
  14. # change the name permanently
  15. sed -i 's/ubuntu/puppet/g' /etc/hosts
  16. sed -i 's/ubuntu/puppet/g' /etc/hostname
  17. #
  18. # To disable the reboot action taken by pressing the Ctrl+Alt+Delete key combination
  19. sed -i 's!#exec shutdown -r now "Control-Alt-Delete pressed"!exec shutdown -r now "Control-Alt-Delete pressed"!g' /etc/init/control-alt-delete.conf
  20. #
  21. # Install, configure and enable firewall for foreman
  22. apt-get -y install ufw
  23. ufw allow ssh
  24. ufw allow 53
  25. ufw allow 67/udp
  26. ufw allow 68/udp
  27. ufw allow 69/udp
  28. ufw allow 80/tcp
  29. ufw allow 443/tcp
  30. ufw allow 3000/tcp
  31. ufw allow 3306/tcp
  32. ufw allow 5910:5930/tcp
  33. ufw allow 5432/tcp
  34. ufw allow 8140/tcp
  35. ufw allow 8443/tcp
  36. ufw enable
  37. #
  38. # update server
  39. apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y
  40. # Install Network Time Protocol, CA certificates & wget
  41. apt-get -y install ntp ca-certificates wget
  42. # Download Puppet
  43. wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
  44. # Install Puppet
  45. dpkg -i puppetlabs-release-trusty.deb
  46. #
  47. # Add Puppet Repository
  48. bash -c 'echo "deb http://deb.theforeman.org/ trusty 1.9" > /etc/apt/sources.list.d/foreman.list'
  49. bash -c 'echo "deb http://deb.theforeman.org/ plugins 1.9" >> /etc/apt/sources.list.d/foreman.list'
  50. wget -q http://deb.theforeman.org/pubkey.gpg -O- | apt-key add -
  51. #
  52. # Install Foreman
  53. apt-get update && apt-get -y install foreman-installer
  54. foreman-installer
Advertisement
Add Comment
Please, Sign In to add comment