Installing Puppet master and slaves
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.
I’m using Xubuntu 12.04.03 32bit
Here is tutorial how you create PuppetMaster and two slaves. And how to use three modules using nodes to determine slaves to use different modules.
These are my steps:
First create PuppetMaster, one slave.
Second make sure simple hello module works.
Thirt create new slave and make sure hello module works.
Final create modules what you want and add nodes to determine what slaves uses what modules.
You’ll should install ssh for you master and slave1.
You can browse for mDNS/DNS-SD services using the Avahi daemon with command
Take ssh connection and test you can ping your master to slave and slave to master.
Install PuppetMaster, stop it, remove old certificates and modify puppet.conf.
In conf file you add these lines. ( pc12 is name your masters $hostname )
Start PuppetMaster
Install Puppet to your slave and edit conf file
Add to conf file your masters hostname
Edit your Puppet to start when booting
Restart Puppet
When you have restarted your slave’s Puppet your master needs to confirm connection between slave and master
Make hellotest module to Puppet
Test that your hellotest module works in your master before sharing it with your slaves
Hellotest module works so you can share it with your slaves
Restart Puppet with your slave so your slave searches new changes what master have done. ( You slaves reloads automatically changes, but now we don’t want to wait it. So that’s why we kick slave1 )
Now we are confirmed that master and slave1 is working correctly. Now we can configure slave2 working too.
Install ssh, take connection and make sure your ping is working both ways.
Install puppet, modify conf file and add same lines that you added before to slave1
Configure puppet to start when booting
And restart Puppet
Now you should see in you master that slave2 is trying to connect you. Confirm it.
Reload Puppet in your slave2 and your hellotest module should work.
Now lets make three different modules
First module installs LibreOffice
Second installs VLC
Third one is installing Inkscape
Add to site.pp your three new modules and let’s make two nodes.
First node makes slave1 install LibreOffice and VLC, but not Inkscape
Second node makes slave2 install LibreOffice and Inkscape, but not VLC
Because we don’t want to wait slaves automatically reload we do it manually.
Slave1 installed softwares
Slave2 installed softwares
Under /etc/puppet your folder/file tree now looks like this.
Sources:
Learning Puppet — Basic Agent/Master Puppet
PuppetMaster on Ubuntu 12.04