Skip to content

LMacchi/puppet_agent_settings

Repository files navigation

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

About

Facts for the Puppet agent settings

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages