Hi,
I'm learning puppet as that is what they use at my current work, though
that could change...
Question 1:
Last place of work, we wrote our own perl based system which was
extremely simple and concise to drive - eg to distribute a file, we
would put it in:
<nfsdir>/noarch/dist/etc/syslog-ng/syslog-ng.conf/ # which means create
a file /etc/syslog-ng/syslog-ng.conf on the target
The contents of the file would be derived from a class based system, eg,
in the above <nfsdir> the following might exist:
BASE
SERVER
CLIENT
somehost
each with a copy of syslog-ng.conf applicable to that class of host.
Each host would be in one or more classes, where a class was also a
class member - until you hit the root class, eg:
somewebserver [isin] WEBSERVER [isin] SERVER [isin] BASE
somelabpc [isin] LAB1PC [isin] LABPC [isin] CLIENT [isin] BASE
Order matters and the class list for a host deterministically resolves
to an ordered list.
So for the example of somewebserver (the host name), it would pick up
/etc/syslog-ng/syslog-ng.conf from
<nfsdir>/noarch/dist/etc/syslog-ng/syslog-ng.conf/SERVER
as that is the most specific applicable class.
Everything would by default use
<nfsdir>/noarch/dist/etc/syslog-ng/syslog-ng.conf/BASE
unless a more specific case existed.
It is trivially possible to add a per host exception for myhost just by
adding a new file called "myhost" into
<nfsdir>/noarch/dist/etc/syslog-ng/syslog-ng.conf/
[We had a simple way of dealing with file modes etc which I'll leave out
for brevity]
In Puppet I seem to have to write a module/whatever.pp to set up the
fact a file is managed. OK, fair enough - I "get" that part of the model.
I also see some sort of linear class inheritance scheme in nodes.pp/
What I don't get is how to leverage that inheritance scheme...
Are there any magic variables that allow me to do something like:
source => [ "puppet:///files/resolv.conf/$mostspecificclass
"puppet:///files/resolv.conf/BASE"
]
Note my use of "class" differs from puppets, so please work around that
- I don't know the correct terminology but it is the on ebased on the
inheritance scheme in nodes.pp which seems sensible.
########################
Question 2
Related:
In a simple case as per documentation:
class syslog {
file { "/etc/syslog-ng/syslog-ng.conf":
path => "/etc/syslog-ng/syslog-ng.conf",
ensure => file,
mode => 644,
owner => root,
group => root,
notify => Service[syslog],
source => "puppet:///files/etc/syslog-ng/syslog-ng.conf"
}
}
is there no variable for the first instance of
"/etc/syslog-ng/syslog-ng.conf"
???
Mentioning a string 3 times or more strikes me as unnecessarily verbose
and likely to lead to typos.
Question 3
#######################
What if /etc/syslog-ng doesn't exist?
I had to resolve that with this syslog.pp :
class syslog {
file { "/etc/syslog-ng":
path => "/tmp/etc/syslog-ng",
ensure => directory,
mode => 755,
owner => root,
group => root,
}
file { "/etc/syslog-ng/syslog-ng.conf":
path => "/tmp/etc/syslog-ng/syslog-ng.conf",
ensure => file,
mode => 644,
owner => root,
group => root,
notify => Service[syslog],
source => "puppet:///files/etc/syslog-ng/syslog-ng.conf"
}
}
or with a recurse:
class syslog {
file { "/etc/syslog-ng/syslog-ng.conf":
path => "/tmp/etc/syslog-ng",
recurse => true,
mode => 644,
owner => root,
group => root,
source => "puppet:///files/etc/syslog-ng"
}
}
First case is verbose again (yuk).
Second case is probably OK but if we have two modules that might want to
create files in a common directory that may or may not exist it's a bit
horrible.
Is there a simple way to say "just create any directories you need to
with default modes"?
I had a quick look at some of the source but couldn't spot any...
##################
At first glance puppet seems extremely verbose (though I do like the
certificate handling). To my mind a config management system should be
solid in its code but simple in its managemnet and I'm not getting the
"simple in its management" right now.
I am open minded but the documentation is a bit scattered (I even bought
the book "Pulling Strings with Puppet" and I'm going off it right now
even to the point of re-implementing the last system I thought was good.
But I would welcome anyone telling me I'm wrong!
Look forward to people's thoughts.
Cheers
Tim
--
Tim Watts
Personal Email
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.