Puppet - Setup / Test Notes

Posted by John
on Wednesday, 09 July 2008

'Put simply, Puppet is a system for automating system administration tasks'

Install

Depends on Ruby (at least 1.8.2), install with:

Client:

sudo aptitude install puppet facter

Server:

sudo aptitude install facter puppet puppetmaster

A Simple Manifest: Managing Ownership of a File

Step one: Create /etc/puppet/manifests/classes/sudo.pp
sudo nano /etc/puppet/manifests/classes/sudo.pp

class sudo {
    file { "/etc/sudoers":
        owner => "root",
        group => "root",
        mode  => 440,
    }
}
Step two: Create /etc/puppet/manifests/site.pp
sudo nano /etc/puppet/manifests/site.pp

import "classes/*"

node default {
    include sudo
}
Step three: Start the Puppetmaster
master % sudo puppetmasterd --mkusers

master % sudo /etc/init.d/puppetmaster restart  (for ubuntu / debian)
Step four: Run a client
client% sudo puppetd --verbose

master% sudo puppetca --list

master% sudo puppetca --sign <client>

GIT Distributed Version Control

Posted by John
on Monday, 12 May 2008
Install
sudo aptitude install git-core
Basic Commands
git init                   ...init repository
git add .                  ...add everything in dir to repository
git commit -a -m 'update'  ...add + commit changes
git diff                   ...show changes since last commit

git add [file]             ...add file
git rm [file]              ...remove file
git mv [file]              ...move file
Mirror Git Repository
rsync -azvCL --delete --progress 
   -e "ssh -i /home/[user]/.ssh/[mykey]" .git/* 
[user]@[user].strongspace.com:/home/[user]/[project]/.git/
Ignore Whitespace
git-apply --whitespace=nowarn