puppetconf

This puppet module to manage puppet.conf
CJ Toolseram

CJ Toolseram

cjtoolseram

24,051 downloads

22,773 latest version

4.6 quality score

Version information

  • 0.2.7 (latest)
  • 0.2.6
  • 0.2.5
  • 0.2.3
  • 0.2.2
  • 0.2.1
  • 0.2.0
released Jul 3rd 2019
This version is compatible with:
  • Any OS that runs Puppet Agent

Start using this module

Documentation

cjtoolseram/puppetconf — version 0.2.7 Jul 3rd 2019

puppetconf

Table of Contents

  1. Description
  2. Easy Setup
  3. Usage
  4. Reference
  5. Variables
  6. Limitations
  7. Development

Description

This module is use to managed all your puppet.conf

NOTE: This module does not install agent!

Easy Setup

For Master of Master Puppet.conf configuration

class { 'puppetconf::baseconf::mom':
}

For Compile Master Puppet.conf configuration

class { 'puppetconf::baseconf::cm':
  master   => 'mom.puppetdebug.vlan',
  caserver => 'mom.puppetdebug.vlan',
}

For Agents Puppet.conf configuration

class { 'puppetconf::baseconf::agent':
  master   => 'mom.puppetdebug.vlan',
  caserver => 'mom.puppetdebug.vlan',
}

Usage

There are 3 define types which are meant for the sections in puppet.conf

  • [main]
  • [master]
  • [agent]

section [main]

puppetconf::main { 'runinterval':
  value     => '1h',
}

section [master]

puppetconf::main { 'environment_timeout':
  value     => '0',
}

section [agent]

puppetconf::main { 'certname':
  value     => 'agent.puppetdebug.vlan',
}

Each of the above define types will require a default path to configuration file. Therefore, would suggest to add defaults or params for them. Examples as below:

$conf_path = '/etc/puppetlabs/puppet/puppet.conf'

Puppetconf::Main {
  conf_path => $conf_path,
}

Puppetconf::Master {
  conf_path => $conf_path,
}

Puppetconf::Agent {
  conf_path => $conf_path,
}

Please refer to the Config Directory for more details.

There are also base classes with specific set of configuration. You can just include them in your classifier.

Master of Master:

class { 'puppetconf::baseconf::mom':
}

Compile Master:

class { 'puppetconf::baseconf::cm':
  master   => 'mom.puppetdebug.vlan',
  caserver => 'mom.puppetdebug.vlan',
}

Agent:

class { 'puppetconf::baseconf::agent':
  master   => 'mom.puppetdebug.vlan',
  caserver => 'mom.puppetdebug.vlan',
}

You can extend the classes by writing a wrapper module. E.g.

class wrapper {
  class { 'puppetconf::baseconf::agent':
    master   => 'mom.puppetdebug.vlan',
    caserver => 'mom.puppetdebug.vlan',
  }

  puppetconf::main { 'environment_timeout':
    value     => '180',
  }
}

This will add environment_timeout = 180 to the main section of this config.

Reference

Base output of puppet.conf from the predefined base classes.

Master of Master:

[main]
certname = pe-201531-master.puppetdebug.vlan
server = pe-201531-master.puppetdebug.vlan
user  = pe-puppet
group = pe-puppet
archive_files = true
archive_file_server = pe-201531-master.puppetdebug.vlan
module_groups = base+pe_only
environmentpath = /etc/puppetlabs/code/environments
ca_server = pe-201531-master.puppetdebug.vlan

[agent]
graph = true

[master]
app_management = true
node_terminus = classifier
storeconfigs = true
storeconfigs_backend = puppetdb
reports = puppetdb
certname = pe-201531-master.puppetdebug.vlan
always_cache_features = true

Compile Master:

[main]
server = mom.puppetdebug.vlan
module_groups = base+pe_only
environmentpath = /etc/puppetlabs/code/environments
user = pe-puppet
group = pe-puppet
ca_server = mom.puppetdebug.vlan
[agent]
certname = cm.puppetdebug.vlan

[master]
app_management = true
node_terminus = classifier
storeconfigs = true
storeconfigs_backend = puppetdb
reports = puppetdb
certname = cm.puppetdebug.vlan
always_cache_features = true
ca = false

Agent:

[main]
server = mom.puppetdebug.vlan
ca_server = mom.puppetdebug.vlan

[agent]
certname = agent.puppetdebug.vlan

Variables

Below are the list of default value in each predefined class:

Class puppetconf::baseconf::mom:

Class puppetconf::baseconf::cm:

Class puppetconf::baseconf::agent:

The above variables have the same name as Puppetlabs configuration attributes. The only exceptions are:

You may also visit the Configuration Reference for further reference.

Limitations

This module will only manage puppet.conf file but will not do any installation on the agent. Any configuration not under a section will not be modified or removed. This also applies to comments!

Development

Feel free to hack around and pull request to add any improvement. Don't be shy!