Saturday, 22 October 2016

Installing Puppet

Installing release packages on Yum-based systems

To enable the Puppet Collection 1 repository, first choose the package based on your operating system and version. The packages are located in the yum.puppetlabs.com repository and named using the following convention:
puppetlabs-release---.noarch.rpm
For instance, the package for Puppet Collection 1 on Red Hat Enterprise Linux 7 (RHEL 7) is puppetlabs-release-pc1-el-7.noarch.rpm.
Next, use the rpm tool as root with the upgrade (-U) flag, and optionally the verbose (-v), and hash (-h) flags:
sudo rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
The rpm tool outputs its progress:
Retrieving https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
1:puppetlabs-release-pc1-0.9.2-1.el################################# [100%]
Note: We only provide the puppet-agent package for recent versions of Puppet on RHEL 5, and to install it you must first download the package as rpm on RHEL 5 doesn’t support installing packages from a URL.

Installing release packages on Apt-based systems

To enable the Puppet Collection 1 repository, first choose the package based on your operating system and version. The packages are located in the apt.puppetlabs.com repository and named using the following convention:
puppetlabs-release--.deb
For instance, the release package for Puppet Collection 1 on Debian 7 “Wheezy” is puppetlabs-release-pc1-wheezy.deb. For Ubuntu releases, the code name is the adjective, not the animal.
Next, download the release package and install it as root using the dpkg tool and the install flag (-i):
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb
sudo dpkg -i puppetlabs-release-pc1-wheezy.deb
Finally, run apt-get update after installing the release package to update the apt package lists.

Confirm you can run Puppet executables

The new location for Puppet’s executables is /opt/puppetlabs/bin/, which is not in your PATHenvironment variable by default.
This doesn’t matter for Puppet services — for instance, service puppet start works regardless of the PATH — but if you’re running interactive puppet commands, you must either add their location to your PATH or execute them using their full path.
To quickly add this location to your PATH for your current terminal session, use the command export PATH=/opt/puppetlabs/bin:$PATH. You can also add this location wherever you configure your PATH, such as your .profile or .bashrc configuration files.

Install the puppet-agent package

For Yum-based systems

On your Puppet agent nodes, run sudo yum install puppet-agent.

For Apt-based systems

On your Puppet agent nodes, run sudo apt-get install puppet-agent.
Do not start the puppet service yet.

Configure critical agent settings

You probably want to set the server setting to your Puppet master’s hostname. The default value is server = puppet, so if your master is reachable at that address, you can skip this.
For other settings you might want to change, see the list of agent-related settings.

Start the puppet service

To start the Puppet service, run sudo /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true.
To manually launch and watch a Puppet run, run sudo /opt/puppetlabs/bin/puppet agent --test.

Sign certificates on the CA master

As each Puppet agent runs for the first time, it submits a certificate signing request (CSR) to the certificate authority (CA) Puppet master. You must log into that server to check for and sign certificates. On the Puppet master:
  1. Run sudo /opt/puppetlabs/bin/puppet cert list to see any outstanding requests.
  2. Run sudo /opt/puppetlabs/bin/puppet cert sign  to sign a request.
After an agent’s certificate is signed, it regularly fetches and applies configuration catalogs from the Puppet master.

No comments:

Post a Comment