Puppet environments
Posted on May 26, 2014
| 4 minutes
| 684 words
| Ton Kersten
For my job I do a lot of Puppet and I thought it was about time to write
some tips and tricks down.
First part of this post is about my environment setup. In my test setup
I use a lot of environments. They are not at all useful, but that’s not
the point. It’s my lab environment so things need to break once in a
while. But with multiple environments Puppetlabs says that you should
switch to directory environments
(PuppetDoc)
but some way or another I cannot get that to work in a good way with my
PE version (3.4.3 (Puppet Enterprise 3.2.3)
). So I started
implementing dynamic environments, which is a simple way of specifying
the directories for your environments.
[Read More]
Puppet Facter Fact
Posted on July 8, 2013
| 1 minutes
| 181 words
| Ton Kersten
Look at me, I made a Puppet Facter Fact!!!
With a lot of thanks to Andrew
Beresford who started the initial code. I just tweaked it.
What it does is rather simple, it finds the expiration date of the SSL
certificate of this host and returns the expiration date and time when
there are less than 30 days left. Otherwise it just returns a -
-sign.
In the Puppet manifest I check if it’s this -
-sign and if not I
generate a warning.
[Read More]
Puppet User Group
Posted on April 7, 2013
| 1 minutes
| 52 words
| Ton Kersten
Yesterday I attended the first meet up of the Dutch Puppet User
Group and I gave a talk about how to start with Puppet.
It was called: Puppet deployment, an introduction and the PDF
slideshow can be viewed or downloaded from
speakerdeck.
If you have any comment, please send me an email.
Puppet updates
Posted on June 18, 2012
| 1 minutes
| 155 words
| Ton Kersten
When working with Puppet and a VCS (like git
and SVN
) it’s nice to
have a simple way of updating the Puppet tree.
My tree is always in /etc/puppet
and owned by user and group
puppet
. User puppet
is allowed to checkout the complete tree from
git
or subversion
.
I have created two one-liners to update the complete tree and make sure
all rights are still correct.
update_svn
~ \{.bash} #!/bin/bash # update_svn su - puppet -c `cd
/etc/puppet; svn up; cd doc; ../bin/gendoc' ~
[Read More]
Updated Pygments
Posted on May 16, 2012
| 1 minutes
| 185 words
| Ton Kersten
I’m using Pygments for quite some time now and I just noticed there was
a new version available (1.5). I installed that and I was wondering if
there would be a lexer included for Puppet. Well, it wasn’t, but a short
Google action directed me to the
Pygments lexer for the
Puppet DSL.
Of course my old CentOS 5 system with Python 2.6 doesn’t want to install
this, so I hacked the Puppet lexer into Pygments.
[Read More]
FreeBSD PXE boot Part 2
Posted on June 9, 2011
| 6 minutes
| 1150 words
| Ton Kersten
Some posts ago I wrote that I was busy to find out how a FreeBSD machine
can be PXE-ed from a Linux server. Well, I found that some time ago, but
I didn’t have the time to type it here, yet. Well, as always, once you
know how it’s done, it’s quite simple. But because a lot of the FreeBSD
documentation is very old (talking about FreeBSD 4, 5 and 6) it takes
some time to find it all.
[Read More]
Why does Puppet keep breaking?????
Posted on May 3, 2011
| 2 minutes
| 334 words
| Ton Kersten
In my previous post I stipulated that I was PXE booting FreeBSD. Well
this works and I will come back on that. But for the configuration I
want to run Puppet. Nice and easy config management.
On my server I run Puppet from source. This because the server is a
CentOS box with a very old Ruby and Puppet. So I decided to run the
Puppet client from source as well. Getting the git repo is easy enough
and installing Puppet should not be to hard.
[Read More]
umask per directory
Posted on December 8, 2010
| 1 minutes
| 148 words
| Ton Kersten
Some users insist on using bash
. This is a good shell, but not as good
as zsh
. But, I do want them to be able to use the per directory
umask
as well as all the zsh
users.
So I started digging, as the bash
shell does not support a chpwd
hook.
This is what I came up with:
chpwd()
{ # Set the initial umask
case "${PWD}/"
in
/etc/puppet/*)
um=$(umask)
umask 007
;;
*)
[[ x"${um}" != x"" ]] && umask ${um}
;;
esac
}
function cd()
{
builtin cd "${@}"
chpwd
}
[Read More]
umask per directory
Posted on December 6, 2010
| 2 minutes
| 320 words
| Ton Kersten
I’ve been working with Puppet some time now, and we are configuring our
way through a lot of hosts, with 6 persons, all working in the same
Puppet master directory.
This should work fine with all UNIX/Linux groups and setgid
directories. But simple problem arose with the git
version control
stuff.
Once in a while the complete git
repo was destroyed and quite a lot of
searching revealed the reason why.
[Read More]