hammi
unread,Nov 10, 2011, 7:57:16 AM11/10/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Puppet Users
Hey everyone,
I'm trying to figure out how to manage my /etc/fstab with puppet on
all my servers. Does anybody have an idea for me how to do? I tried it
with augeas but I didn't like the results I got so far... here is what
I've tried:
define conf (
$id = "01",
$spec = " ",
$file = " ",
$vfstype = " ",
$opt = "",
$dump = "0",
$passno = "0"
) {
$key = "$spec/$file/$vfstype/$opt/$dump/$passno"
$context = "/files/etc/fstab"
$path_list = "spec = \"$spec\""
$path_exact = "*[spec=\"$spec\"]"
augeas { "fstab/$key":
context => "$context",
onlyif => "match $path_exact size==0",
changes => [
"rm $path_list",
"set $id/spec $spec",
"set $id/file $file",
"set $id/vfstype $vfstype",
$opt,
"set $id/dump $dump",
"set $id/passno $passno",
],
}
and here the nodes.pp
fstab::config::conf {
"webdav": id => 01, spec => 'server:/webdav', file => '/var/
www/dav', vfstype => 'nfs4', opt => ["set 01/opt[1] ro", "set 01/
opt[2] defaults"], dump => '0', passno => '0';
}
but its not a really good solution...
I would appreciate it if I would get any help :)
best regards
David