Puppet Recipes

The purpose of this document is to show common uses of Puppet.

A Cookbook

File file { "/etc/yum/pluginconf.d/fastestmirror.conf": owner => "root", group => "root", mode => "0644", source => ["puppet:///modules/centos6_base/etc/yum/pluginconf.d/fastestmirror.conf",] }

Directory

file { "/opt/jgs": ensure => directory, owner => "root", group => "root", mode => "0744", }

Recursive directories

# /opt/jgs/conf recursive directory file { "/opt/jgs/conf": ensure => directory, recurse => true, purge => true, # purge all unmanaged junk force => true, # also purge subdirs and links etc. owner => root, group => root, mode => "0744", source => ["puppet:///modules/jgs_app_server/opt/jgs/conf",] }

Symlinks

# /opt/config -> /opt/jgs/conf file { "/opt/config": ensure => link, target => "/opt/jgs/conf", }

[Edit]