puppet_agent_settings

pdk
Add facts to expose puppet agent settings

Laura

laura

5,910 downloads

2,340 latest version

5.0 quality score

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

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'],
}