
(Senior DevOps Manager & Principal Architect)
The Basics
Recommended Experience
notify {'Hello World':}
The notify resource type can be used to send a message to the agent log or screen if being used interactively. This makes a great and simple first manifest.
sudo puppet parser validate helloworld.pp
Although this manifest is very simple we should get in the habit of validating code as we create it. Helping to keep our code robust and healthy.
sudo puppet parser validate helloworld.pp
sudo puppet apply -e "notify { 'Hello World': }"
We can use the application puppet apply to enforce a local manifest or puppet code.
sudo pupet resource service puppet
service { 'puppet':
ensure => 'stopped',
enable => false,
}
sudo puppet parser validate puppet-service.pp
sudo puppet apply puppet-service.pp
We currently do want to use the Puppet agent. This can run as a daemon service so we should check that it is both stopped and disabled.
service { 'puppet':
ensure => 'stopped',
enable => false,
}
Ensure the Puppet Agent is not running and is disabled.
Most languages have their recommend style guide. The way the code should be laid out. The full guide is in the documentation:
http://docs.puppet.com/guide/style_guide.html
sudo puppet module install theurbanpenguin/puppet_vim
include puppet_vim
sudo puppet parser validate puppet_vim.pp
sudo puppet apply puppet_vim.pp
IDEs or integrated Design Environments can help with styling. We use the text editor VIM in this course. Even this through can help with styling. It is easiest to install the required elements using a Puppet Module.
scmGalaxy — One stop Destination for DevOps consulting, training and services.
Looking for Puppet course? Classroom Training|Online Training |Corporate Training