Managing /etc/fstab with puppet

2,260 views
Skip to first unread message

hammi

unread,
Nov 10, 2011, 7:57:16 AM11/10/11
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

Len Rugen

unread,
Nov 11, 2011, 3:40:58 PM11/11/11
to puppet...@googlegroups.com

        mount { "/vtl/$vtldir":
                ensure => mounted,
                device => "server:/nfsdir/$vtldir",
                atboot => true,
                fstype => "nfs",
                options => "intr,hard,rsize=32768,wsize=32768,proto=tcp,vers=3,nolock",
                require => File["/vtl/$vtldir"]
        }            



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


Reply all
Reply to author
Forward
0 new messages