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

Result

Hello Puppet!
Puppet module working as well

Source

http://terokarvinen.com/2013/hello-puppet-revisited-%E2%80%93-on-ubuntu-12-04-lts