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
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.