Forge Home

puppet_agent_settings

Add facts to expose puppet agent settings

7,683 downloads

3,926 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.1.2 (latest)
  • 0.1.1
  • 0.1.0
released May 28th 2019
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • RedHat, CentOS, Solaris, SLES, Debian, Ubuntu, Gentoo, AIX, Windows, OSX

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'laura-puppet_agent_settings', '0.1.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add laura-puppet_agent_settings
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install laura-puppet_agent_settings --version 0.1.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

laura/puppet_agent_settings — version 0.1.2 May 28th 2019

Puppet Agent Settings Facts

This module adds Puppet agent settings facts:

[root@master ~]# facter -p puppet_agent_settings
{
  config => "/etc/puppetlabs/puppet/puppet.conf",
  confdir => "/etc/puppetlabs/puppet",
  ssldir => "/etc/puppetlabs/puppet/ssl"
}

Why not use the settings variable?

[root@master ~]# puppet apply -e 'notice($settings::confdir)'
Notice: Scope(Class[main]): /etc/puppetlabs/puppet
Notice: Compiled catalog for master.lmacchi.vm in environment production in 0.21 seconds
Notice: Applied catalog in 0.29 seconds
[root@master ~]# puppet apply -e 'notice($settings::config)'
Notice: Scope(Class[main]): /etc/puppetlabs/puppet/puppet.conf
Notice: Compiled catalog for master.lmacchi.vm in environment production in 0.23 seconds
Notice: Applied catalog in 0.37 seconds
[root@master ~]# puppet apply -e 'notice($settings::ssldir)'
Notice: Scope(Class[main]): /etc/puppetlabs/puppet/ssl
Notice: Compiled catalog for master.lmacchi.vm in environment production in 0.20 seconds
Notice: Applied catalog in 0.32 seconds

As explained in the Puppet docs, the settings variable return values from the master, which is always Linux. This module returns paths from the agent, which are different for Windows agents.

Example

ini_setting { 'Change runinterval in puppet.conf':
  ensure  => present,
  section => 'agent',
  setting => 'runinterval',
  value   => '2h',
  path    => $facts['puppet_agent_settings']['config'],
}