As it is defined in puppet.conf, site.pp file could be found at /biz/puppet/hieradata/${environment}. In terms of QA environment it is /biz/puppet/hieradata/qa:
Here, manifest (aka site.pp) assigns a single role to every node in the cluster. Nodes are identified by the full domain name. Let's assume that:
- Puppet Master lives at ip-10-0-8-10.sampup.com
- ip-10-0-8-11.sampup.com and ip-10-0-8-12.sampup.com are Puppet Agents.
You might be asking what class {'configuration':} is about? This where actual application configuration is delivered to agent nodes, and we will address this module in the last post of the series.
Corresponding profiles are defined in /biz/puppet/modules/profile module:
Lets discuss Hiera configuration. There is a lot of reading available [1], however we can summarize following:
- Hiera data files are named after node's fully qualified domain name
For instance: ip-10-0-8-12.sampup.com.json - Files contain key-values pairs
For instance: "ntp::restrict" : true - Each key comprise of the module name and the property name, joined by ::
For instance, in "ntp::restrict" : true - ntp is the module name
- restrict is the property name
- true is the value - Declared key-values are applied during invocation of the parametrized Puppet classes
- In case Hiera finds no filename matching the node's domain name, it will first look in common.json
Puppet will resolve to the default module parameters, should it find no relevant key-values pairs.
/biz/puppet/hieradata/qa/ip-10-0-8-12.sampup.com.json
Continue with Jenkins and application configuration.
[1] Hiera reading
http://docs.puppetlabs.com/hiera/1/puppet.html#hiera-lookup-functions
No comments:
Post a Comment