Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # puppet for ubuntu 14.04 LTS server
- sudo apt-get update -y && sudo apt-get upgrade -y
- #
- # 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.)
- # Note: The default puppet master hostname is puppet.
- # Your agent nodes can be ready sooner if this hostname resolves to your puppet master.
- #
- 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.
- #
- # This section will cover installing and configuring Puppet in a client/server configuration. This simple example will demonstrate how to install Apache using Puppet.
- #
- # 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.
- #
- # 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:
- #
- # 127.0.0.1 localhost.localdomain localhost puppet
- # 192.168.1.17 puppetclient.example.com puppetclient
- # On each Puppet client, add an entry for the server:
- #
- # 192.168.1.16 puppetmaster.example.com puppetmaster puppet
- # Replace the example IP addresses and domain names above with your actual server and client addresses and domain names.
- #
- # Installatie
- # To install Puppet on the client machine, or machines, enter:
- sudo apt-get install puppet -y
- #
- # Configuratie
- #
- # First, configure the Puppet agent daemon to start. Edit /etc/default/puppet, changing START to yes:
- sudo sed -i 's!START=no!START=yes!g' /etc/default/puppet
- # Then start the service:
- sudo service puppet start
- #
- # View the client cert fingerprint
- sudo puppet agent --fingerprint > fingerprint.txt
- # Back on the Puppet server, view pending certificate signing requests:
- sudo puppet cert list > cert-list.txt
- # On the Puppet server, verify the fingerprint of the client and sign puppetclient's cert:
- sudo puppet cert sign puppetclient.example.com > fingerprint-cert.txt
- # 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.
- sudo puppet agent --test > test-puppet-service.txt
- # 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.
- #
- # configuratie firewall (ip4+ip6) https://help.ubuntu.com/14.04/serverguide/firewall.html
- sudo ufw enable
- sudo ufw logging on
- sudo ufw allow 22
- sudo ufw allow 80
- sudo ufw allow 443
- sudo ufw allow 8140
- #
- sudo reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement