Puppet howto Ubuntu

I’m using 2 Ubuntu Lucid 10.10 for this setup.

On the server run:

apt-get install puppetmaster

At the time I’m writing this in the repos version 2.6.1 is available.

On the client run :

apt-get install puppet

Note that /etc/hosts needs to contain the IP and host of both client and server, e.g:

10.0.0.30 depot.server.org depot
10.0.0.31 n1.server.org n1

Create a default manifest file (/etc/puppet/manifests/site.pp) and put in it :


class test_class {
file { "/tmp/test":
ensure => present,
mode => 644,
owner => root,
group => root
}
}

# tell puppet on which client to run the class
node n1 {
include test_class
}

Then on the server run :

/etc/init.d/puppetmaster start

and on client :

puppetd –server depot.server.org –waitforcert 60 –test

After this you should see on the server a new host when running :

puppetca –list

In order to sign this host on the server side you need to run :

puppetca –sign n1.server.org

After this on the client side /tmp/test should be created.

Centos 6.0 XenServer templates

To add templates for CentOS 6.0 you can use the RHEL 6.0 templates:

For CentOS 32 bit run:

xe vm-clone uuid=xe template-list name-label=Red Hat Enterprise Linux 6 (32-bit) --minimal new-name-label=”CentOS 6.0 (32-bit)”

For CentOS 64 bit run:

xe vm-clone uuid=xe template-list name-label=Red Hat Enterprise Linux 6 (64-bit) --minimal new-name-label=”CentOS 6.0 (64-bit)”

Delete template XenServer

Sometimes XenServer doesn’t allow you to delete templates from the XenCenter GUI or even the CLI. Here is how to delete templates from the CLI in three steps:

Run:

xe template-list name-label=CentOS 5.6 (32-bit)
And remember the uuid:
uuid ( RO) : 0ce71430-d7ef-00f8-07d9-4166953c4f19

Then:

xe template-param-set other-config:default_template=false uuid=0ce71430-d7ef-00f8-07d9-4166953c4f19

Then :

xe template-param-set is-a-template=false uuid=0ce71430-d7ef-00f8-07d9-4166953c4f19

And then:

xe vm-destroy uuid=0ce71430-d7ef-00f8-07d9-4166953c4f19