This module will manage the puppet-agent in your system.
Actually this is a very simple module.
Yes, you can use it in production, but you may miss some parameters for production use.
The main objective is to manage puppet-agent with minimal intervention in the default files.
Augeas resource type is used to change parameters inside the puppet.conf.
This module was tested under these platforms
- RedHat 5, 6 and 7, 8
- CentOS 5, 6 and 7, 8
- Scientific 6 and 7
- Debian 7, 8 and 9
- Ubuntu 14.04 and 16.04
Tested only in X86_64 arch.
You need internet to install packages.
You should configure your hostname properly.
You should configure your /etc/hosts properly.
ip fqdn alias
- Puppet >= 5.x
- Hiera >= 3.4
- Facter >= 2.5
via git
# cd /etc/puppetlabs/code/environment/production/modules
# git clone https://github.com/gutocarvalho/puppet-agent.git puppetagent
via puppet
# puppet module install gutocarvalho/puppetagent
via puppetfile
mod 'gutocarvalho-puppetagent'
puppet apply -e "include puppetagent"
class { 'puppetagent':
agent_certname => $trusted['certname'],
agent_version => '5.3.3-1.el7',
agent_server => 'pupperserver.hacklab',
agent_environment => 'production',
agent_runinterval => 3600
}
class { 'puppetagent':
agent_certname => $trusted['certname'],
agent_version => '5.3.3-1.el6',
agent_server => 'pupperserver.hacklab',
agent_environment => 'production',
agent_runinterval => 3600
}
class { 'puppetagent':
agent_certname => $trusted['certname'],
agent_version => '5.3.3-1.el5',
agent_server => 'pupperserver.hacklab',
agent_environment => 'production',
agent_runinterval => 3600
}
class { 'puppetagent':
agent_certname => $trusted['certname'],
agent_version => '5.3.3-1trusty',
agent_server => 'pupperserver.hacklab',
agent_environment => 'production',
agent_runinterval => 3600
}
class { 'puppetagent':
agent_certname => $trusted['certname'],
agent_version => '5.3.3-1xenial',
agent_server => 'pupperserver.hacklab',
agent_environment => 'production',
agent_runinterval => 3600
}
class { 'puppetagent':
agent_certname => $trusted['certname'],
agent_version => '5.3.3-1wheezy',
agent_server => 'pupperserver.hacklab',
agent_environment => 'production',
agent_runinterval => 3600
}
class { 'puppetagent':
agent_certname => $trusted['certname'],
agent_version => '5.3.3-1jessie',
agent_server => 'pupperserver.hacklab',
agent_environment => 'production',
agent_runinterval => 3600
}
class { 'puppetagent':
agent_certname => $trusted['certname'],
agent_version => '5.3.3-1stretch',
agent_server => 'pupperserver.hacklab',
agent_environment => 'production',
agent_runinterval => 3600
}
puppetagent
puppetagent::install (private)
puppetagent::config (private)
puppetagent::service (private)
Type: String
Certificate name for the agent
Type: String
The puppet agent package version (5.3.0-1xenial|installed|latest)
Type: String
The puppet master server to which the puppet agent should connect.
Type: String
Set which environment your puppet agent will use.
Type: Integer
Set how often puppet agent applies the catalog in seconds.
Type: Boolean
Whether to sleep for a random amount of time
Type: Integer
Set maximum time to delay before an agents first run.
Type: Boolean
Whether to apply catalogs in noop mode
Type: String
Default logging level for messages from Puppet
Type: String
Where to send log messages. (e.g. syslog, absolut path to a logfile)
puppetagent::agent_certname: "%{trusted.certname}"
puppetagent::agent_version: 'installed'
puppetagent::agent_server: 'puppetserver.hacklab'
puppetagent::agent_environment: 'production'
puppetagent::service_name: 'puppet'
puppetagent::service_ensure: 'running'
puppetagent::service_enable: true
puppetagent::agent_splay: false
puppetagent::agent_noop: false
puppetagent::agent_splaylimit: 1800
puppetagent::agent_log_level: 'notice'
puppetagent::agent_logdest: 'syslog'
puppetagent::agent_runinterval: 3600
This is the Hiera v5 configuration inside the module.
This module does not have params class, everything is under hiera v5.
---
version: 5
defaults:
datadir: data
data_hash: yaml_data
hierarchy:
- name: "OSes"
paths:
- "oses/distro/%{facts.os.name}/%{facts.os.release.major}.yaml"
- "oses/family/%{facts.os.family}.yaml"
- name: "common"
path: "common.yaml"
This is an example of files under modules/puppetserver/data
oses/family/RedHat.yaml
oses/family/Debian.yaml
oses/distro/CentOS/5.yaml
oses/distro/CentOS/7.yaml
oses/distro/CentOS/8.yaml
oses/distro/Ubuntu/14.04.yaml
oses/distro/Ubuntu/16.04.yaml
oses/distro/Debian/7.yaml
oses/distro/Debian/8.yaml
oses/distro/Debian/9.yaml
This module was developed using
- Puppet 5.3.3
- Hiera 3.4.2 (v5 format)
- Facter 2.5.1
- CentOS 7
- VirtualBox 5.1.28
- Vagrant 2.0
- box: gutocarvalho/centos7x64puppet5
This module uses puppet-lint, puppet-syntax, metadata-json-lint, rspec-puppet, beaker and travis-ci. We hope you use them before submitting your PR.
gem install bundler --no-rdoc --no-ri
bundle install --without development
bundle exec rake syntax
bundle exec rake lint
bundle exec rake metadata_lint
bundle exec rake spec
Acceptance tests (Beaker) can be executed using ./acceptance.sh. There is a matrix 1/8 to test this class under Centos 5/6/7, Debian 7/8/9 and Ubuntu 14.04/16.04.
If you want a detailed output, set this before run acceptance.sh
export BEAKER_debug=true
If you want to test a specific OS from our matrix
BEAKER_set=centos-5-x64 bundle exec rake beaker
Our matrix values
centos-5-x64
centos-6-x64
centos-7-x64
debian-7-x64
debian-8-x64
debian-9-x64
ubuntu-1404-x64
ubuntu-1604-x64
This matrix needs vagrant (>=2.0) and virtualbox (>=5.1) to work properly, make sure that you have both of them installed.
Guto Carvalho (gutocarvalho at gmail dot com)
Florian Faltermeier, University of Innsbruck (florian dot faltermeier @ uibk dot ac dot at)