/cjtoolseram-puppetconf

This puppet module to manage puppet.conf

Primary LanguagePuppet

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:

caserver = $trusted['certname']
archive_files = true
peuser = pe-puppet
pegroup = pe-puppet
archive_file_server = $trusted['certname']
module_groups = base+pe_only
environmentpath = /etc/puppetlabs/code/environments
conf_path = /etc/puppetlabs/puppet/puppet.conf
app_management = false
node_terminus = classifier
storeconfigs = true
storeconfigs_backend = puppetdb
always_cache_features = true
reports_to = puppetdb
graph = true

Class puppetconf::baseconf::cm:

master = undef
caserver = undef
module_groups = base+pe_only
peuser = pe-puppet
pegroup = pe-puppet
environmentpath = /etc/puppetlabs/code/environments
conf_path = /etc/puppetlabs/puppet/puppet.conf
ca_boolean = false
app_management = true
node_terminus = classifier
storeconfigs = true
storeconfigs_backend = puppetdb
always_cache_features = true
reports_to = puppetdb

Class puppetconf::baseconf::agent:

master = undef
caserver = undef
conf_path = /etc/puppetlabs/puppet/puppet.conf

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

peuser -> user
pegroup -> group
caserver -> ca_server
ca_boolean -> ca
reports_to -> reports
conf_path -> confdir

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!