I Generally do something like the following
I create a template for config files
define configfile(owner = root, server = ''servername'', group =
root, mode = 644, source, backup = false, recurse = false, ensure = file) {
file { $name:
mode => $mode,
owner => $owner,
group => $group,
backup => $backup,
recurse => $recurse,
ensure => $ensure,
source => "puppet://$server/config/$source"
}
}
then you can just do
configfile{ "/etc/resolv.conf":
source=>"/config/resolv.conf"
}
Cheers
Brendan
________________________________
From: puppet-users-bounces@madstop.com on behalf of Kenton Brede
Sent: Sun 11/02/2007 2:26 PM
To: puppet-users@madstop.com
Subject: [Puppet-users] tighten up class?
The following works fine but is there some way to make it more succinct?
Thanks,
Kent
class obsd_etc_static {
file { "/etc/mygate":
owner => root, group => wheel, mode => 644,
backup => main,
source => "puppet://example.com/obsd_static/mygate"
}
file { "/etc/rc.conf":
owner => root, group => wheel, mode => 644,
backup => main,
source => "puppet://example.com/obsd_static/rc.conf"
}
file { "/etc/inetd.conf":
owner => root, group => wheel, mode => 644,
backup => main,
source => "puppet://example.com/obsd_static/inetd.conf"
}
file { "/etc/sysctl.conf":
owner => root, group => wheel, mode => 644,
backup => main,
source => "puppet://example.com/obsd_static/sysctl.conf"
}
file { "/etc/wsconsctl.conf":
owner => root, group => wheel, mode => 644,
backup => main,
source => "puppet://example.com/obsd_static/wsconsctl.conf"
}
}
--
"It may be true that the law cannot make a man love me, but it can stop him
from lynching me, and I think that''s pretty important." - Martin
Luther King Jr.
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users