First, let's recall that roles contain class {'configuration':} declaration. This tiny module allows us to keep a current copy of the apps configuration on the target nodes.
Module's file tree looks as follow:
The manifest file itself (init.pp) is as follows:
It can be summarized as procedure that base on ${environment} name and ${application} name copies configuration files from /biz/puppet/hieradata/${environment}/${application} on Puppet Master to /biz/configuration/${application} on Puppet Agent node.
It is important that destination point has no reference of the ${environment}. This later allows Jenkins to perform configuration update in a complete agnostic way - with only ${application} name being required.
Consider the file tree under files folder. It is grouped by environment and application name. Should you like to add a new application, let's say HelloWorld to the CI env, you would have to:
- Make sure that folder /biz/puppet/hieradata/ci exist
- Create new subfolder /biz/puppet/hieradata/ci/HelloWorld
- Place HelloWorld configuration files into /biz/puppet/hieradata/ci/HelloWorld
- Create/update Jenkins script to take the application configuration files from /biz/configuration/${application}
- Create/update a role to reference the HelloWorld:
The flow can be illustrated as:
Fig 1: Deployment process |
Last, but not least - let's describe development process on Puppet+Hiera+Jenkins govern cluster:
Fig 2: Development process |
Cheers!
No comments:
Post a Comment