A Puppet module to install and manage Puppet v5.x
This module currently installs and configures the following Puppet software and services:
puppet-agent
This module is written to run on Puppet 5.x, many operating system disributions do not have this package available in their standard package repostitories. The bootstrap
directory contains a collection of bash scripts that will add the Puppetlabs Puppet 5 repositories, install the puppet-agent
package, install Rubygems, and finally install librarian-puppet
.
These scripts will need to be run as an administrator, and often they require re-logging to update the bash environment and paths after installation.
Once this bootstrap is completed the module and test scripts should all work.
-
Login as root
-
Make the directory
/etc/puppetlabs/code/modules
: -
Clone this repository (or install it from the Puppet Forge) to
/etc/puppetlabs/code/modules/puppet5
:$ git clone https://github.com/Aethylred/puppet-puppet5.git /etc/puppetlabs/code/modules/puppet5
-
Run the bootstrap script appropriate for your OS and distribution:
$ /etc/puppetlabs/code/modules/puppet5/bootstrap/puppet5_bootstrap_rhel
-
Relog as root to refresh paths and environment
-
Execute test manifest to verify module:
$ puppet apply /etc/puppetlabs/code/modules/puppet5/tests/puppet-agent.pp
OS | Script |
---|---|
CentOS 5,6,7 | puppet5_bootstrap_rhel |
RedHat 5,6,7 | puppet5_bootstrap_rhel |
This module requires the installation of a package repository that provides the Puppet v5.x packages. It includes the puppet5::repos
class to configure the Puppetlabs repositories, however this class is not explicitly required. Any process that make the packages available via a suitable package provider will do, allowing for the configuration of local mirrors or other alternative repositories for installing Puppet v5.x
It is recommended that the class is installed using the following patterns.
class{'puppet5::repos':
before => Class['puppet5']
}
include puppet5
yumrepo{'local_mirror':
enabled => true,
descr => "A local mirror of the Puppetlabs Puppet5 Package el ${::operatingsystemmajrelease} repository",
...
before => Class['puppet5'],
}
include puppet5
This wrapper class can be used to install, configure and manage the puppet-agent
service using a single class declaration. It wraps the puppet5::agent::install
, puppet5::agent::config
and puppet5::agent::service
classes. All parameters are passed through to the other classes with minimal changes.
The name of package to be installed. The default is puppet-agent
The version of the package to be installed. The default is provided by Hiera.
Ensure if the package is installed
or absent
, the default is installed
If set to running
the puppet-agent
service will be enabled and set to run at boot. If it is set to stopped
the service will be stopped and disabled. The default is running
This class installs the puppet-agent
package and ensures that all the directories created by the package exist and have the correct ownership and permissions.
The name of the package to be installed. The default is puppet-agent
The version of the package to be installed. The default is provided by Hiera.
Ensure if the package is installed
or absent
, the default is installed
This class manages the puppet.conf
configuration file. This module only uses puppet.conf
to manage the [main]
and [agent]
sections, configuration of other Puppet services will be in their own independent configuration files.
An array of paths used to set the basemoduelpath setting that lists the directories where puppet checks for modules. Due to an issue with how Puppet 5.0.0 converts an Array
to a String
, spaces are stripped from paths when they substituted into puppet.conf
If set to 'present' puppet.conf
is deployed, if 'absent' it is removed. Default 'installed'
Sets the fully qualified domain name, resovable name, or IP address of a puppet server or puppet master. Default leaves this unset.
Sets the puppet environment. Default leaves this unset.
Sets how often the puppet agent runs. Default leaves this unset. the puppet-agent
will run every 30m by default.
This class manages the state of the puppet-agent
service.
If set to 'enabled' the puppet-agent
service runs at boot.
This internal class has no paramters. Used by other classes to check if the puppet5
module is being used on a supported operating system.
This class installs the Puppetlabs repositories for installing Puppet5. While this module requires a package repostory to provide the Puppet v5.x packages for installation, it does not depend on the Puppetlabs repository or this class.
Many things are defined in Hiera that are not controlled by parameters. These can be over-ridden in a Hiera datastore on the local machine or Puppet server. Check the data
directory for defaults.
This module is incomplete, however as it already has some functionality around configuring the puppet-agent
it's suitable for release.
The following features are still to be done:
The current focus is on RedHat/CentOS 7, some el6
support is included by may not be complete or thoroughly tested. Other operating systems are being considerd
- Redhat/CentOS 5: This module should also be compatible with
el5
onceel6
support is complete - SUSE/OpenSUSE: We have a use case.
- Debian/Ubuntu: Should be straightforward, will only go back as far as 14.04 LTS.
- Windows: Maybe.
- AIX: No. We don't do that anymore.
puppetdb
: it should configure; puppet-agent, puppetserver and the puppetb. It may be possible to set uppuppet-agent
to use apuppetdb
service directly in deployments without apuppetserver
puppetserver
: it should set up apuppetserver
that's integrated with apuppetdb
that can be local or remote, and some kind of dashboard.hiera
: it should only set up the configuration and the data store directory structure, but not the content of the data store.