Define Types example in Puppet
In this tutorial I’m creating hello_define module that uses Puppet define types. Hello_define module creates two files with different content.
If you haven’t seen my previous tutorials you should see them:
How to install Puppet, Hello World module using template to Puppet,
Installing Apache and PHP with Puppet module, Installing Puppet master and slaves, Parametrized Class with Puppet.
I’m using Xubuntu 12.04.03 32bit
Install and create
Update apt and use it to install Puppet
Create folders where you add your init.pp file
Then create init.pp file and modify it
Make hello_define class that creates two files with different content using define types. Modify your init.pp file look like this
Apply Define Types
Apply hello_define module with Puppet.
Now hello_define module has created two files. Files are in /tmp/ folder. You can cat those files and see what are inside them
The folder tree looks now like this
Comment and let me know what you think of this guide. Did you manage to do hello_define module? Was there something incorrect?
I used Puppet in this blog post. Puppet is create way to centralize manage many computers at the same time. You should check it out. I have created couple beginners guides. If you want to learn more you should check them out:
How to install Puppet, Hello World module using template to Puppet,
Installing Apache and PHP with Puppet module, Installing Puppet master and slaves, Parametrized Class with Puppet.