henrydenhengst

Puppet CLIENT for Ubuntu 14.04 LTS

Aug 29th, 2014
375
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # puppet for ubuntu 14.04 LTS server
  3. sudo apt-get update -y && sudo apt-get upgrade -y
  4. #
  5. # Name resolution: Every node must have a unique hostname.
  6. # Forward and reverse DNS must both be configured correctly.
  7. # (If your site lacks DNS, you must write an /etc/hosts file on each node.)
  8. # Note: The default puppet master hostname is puppet.
  9. # Your agent nodes can be ready sooner if this hostname resolves to your puppet master.
  10. #
  11. sudo apt-get install ntp -y
  12. #
  13. # Puppet
  14. #
  15. # 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.
  16. #
  17. # This section will cover installing and configuring Puppet in a client/server configuration. This simple example will demonstrate how to install Apache using Puppet.
  18. #
  19. # Prior to configuring puppet you may want to add a DNS CNAME record for puppet.example.com, where example.com is your domain. By default Puppet clients check DNS for puppet.example.com as the puppet server name, or Puppet Master. See Domain Name Service (DNS) for more DNS details.
  20. #
  21. # If you do not wish to use DNS, you can add entries to the server and client /etc/hosts file. For example, in the Puppet server's /etc/hosts file add:
  22. #
  23. # 127.0.0.1 localhost.localdomain localhost puppet
  24. # 192.168.1.17 puppetclient.example.com puppetclient
  25. # On each Puppet client, add an entry for the server:
  26. #
  27. # 192.168.1.16 puppetmaster.example.com puppetmaster puppet
  28. # Replace the example IP addresses and domain names above with your actual server and client addresses and domain names.
  29. #
  30. # Installatie
  31. # To install Puppet on the client machine, or machines, enter:
  32. sudo apt-get install puppet -y
  33. #
  34. # Configuratie
  35. #
  36. # First, configure the Puppet agent daemon to start. Edit /etc/default/puppet, changing START to yes:
  37. sudo sed -i 's!START=no!START=yes!g' /etc/default/puppet
  38. # Then start the service:
  39. sudo service puppet start
  40. #
  41. # View the client cert fingerprint
  42. sudo puppet agent --fingerprint > fingerprint.txt
  43. # Back on the Puppet server, view pending certificate signing requests:
  44. sudo puppet cert list > cert-list.txt
  45. # On the Puppet server, verify the fingerprint of the client and sign puppetclient's cert:
  46. sudo puppet cert sign puppetclient.example.com > fingerprint-cert.txt
  47. # On the Puppet client, run the puppet agent manually in the foreground. This step isn't strictly speaking necessary, but it is the best way to test and debug the puppet service.
  48. sudo puppet agent --test > test-puppet-service.txt
  49. # Check /var/log/syslog on both hosts for any errors with the configuration. If all goes well the apache2 package and it's dependencies will be installed on the Puppet client.
  50. #
  51. # configuratie firewall (ip4+ip6) https://help.ubuntu.com/14.04/serverguide/firewall.html
  52. sudo ufw enable
  53. sudo ufw logging on
  54. sudo ufw allow 22
  55. sudo ufw allow 80
  56. sudo ufw allow 443
  57. sudo ufw allow 8140
  58. #
  59. sudo reboot
RAW Paste Data