I am writing this post as part of course Linuxin keskitetty hallinta held by Tero Karvinen. In this post I will write hello world puppet module.

Install Puppet

$ sudo apt-get update
$ sudo apt-get install puppet

Puppet oneliner

$ puppet apply -e 'file { "/tmp/helloPuppet": content => "Hello Puppet!" }'

Create new hello module

$ mkdir -p modules/hello/manifests/
$ nano modules/hello/manifests/init.pp

Do next class in file init.pp:

class hello {
  file { '/tmp/helloPuppet':
    content => "Hello Puppet!\nPuppet module working as well!"

Run puppet module:

$ puppet apply --modulepath modules/ -e 'class {"hello":}'

Last we verify that module works right:

$ less /tmp/helloPuppet


Hello Puppet!
Puppet module working as well