-
Notifications
You must be signed in to change notification settings - Fork 0
Puppet 4 :: Modules and Classes
Sandesh Kota edited this page Jun 22, 2018
·
17 revisions
Environments -> Modules -> classes -> parameters -> Inheritance -> Custom Resources
- Env: Support for Production and Development Code
- Env: puppet config print environment
- Env: Support for Isolation of Departmental Code
- Env: puppet config print environmentpath
- Env: Helps in using different versions of the module for each environment
- Module: Can be located in either the environment directory or a common shared directory
- Create environment in /etc/puppetlabs/code/environments/dev/{modules,manifests}
- Install module as follows
puppet module install ntp --environment dev - Module: To see the list
puppet module list --environment dev - Puppet configuration /etc/puppetlabs/puppet/puppet.conf
- To work under a environment
puppet config set environment dev
- Puppet module is simply a directory tree with specific and predictable content
- Module contains
- Name (ntp/)
- manifests/init.pp
- files/
- lib/ # can contain facts
- facts.d/ # external facts
- templates/ # erb (embeded ruby file) | Puppet4 -> epb (embeded manifest file)
- examples/
- Name (ntp/)
- manifest must contain a class with the same name as the module
- Modules Metadata
- we can use
puppet module generate skota/test# test = module name, skota = user name/ org name- this will start an interview process to collect other information i.e, version no, author etc..
- To skip all we can use
puppet module generate skota/test --skip-interview- This will use the defaults - stores data in metadata.json
- This will help us in versioning our Modules
-
tree modulewill list down the file structure
- we can use