Also see this blog post: http://www.puppetlabs.com/blog/puppets-google-summer-of-code/ which discusses this possibly useful module: http://github.com/blkperl/puppet-network
----- Original Message ----- > From: "Andrew Pollock" <[email protected]> > To: [email protected], [email protected] > Cc: "Bryan Kearney" <[email protected]>, "Free Ekanayaka" > <[email protected]> > Sent: Wednesday, October 6, 2010 2:31:07 PM > Subject: [Puppet Users] Using Augeas to manage /etc/network/interfaces from > Puppet > Hi, > > > Sorry for the broad distribution, I'm not sure who best can help me. > > > I'm trying to add a new interface stanza to /etc/network/interfaces. > > > With augtool, I can accomplish this with the following: > > > > set /files/etc/network/interfaces/iface[last()+1] bond1 > set /files/etc/network/interfaces/iface[last()]/family inet > set /files/etc/network/interfaces/iface[last()]/method dhcp > set /files/etc/network/interfaces/iface[last()]/slaves eth2 > > > I've been able to translate that to the following Puppet resource: > > > > augeas { "bond1": > context => "/files/etc/network/interfaces", > changes => [ > "set iface[last()+1] bond1", > "set iface[last()]/family inet", > "set iface[last()]/method dhcp", > "set iface[last()]/slaves eth2", > ], > } > > > All good so far, except this will unconditionally create the interface > stanza every time Puppet runs. That's fine, this is what the "onlyif" > directive is for, right? I just can't make it work. > > > I'm a bit hazy on how "match" works. From augtool, I can go > > > match /files/etc/network/interfaces/iface[*] > > > and sort of get back a list of interface names. I was thinking that > maybe I could do something with that, but I'm not entirely sure what. > > > I hear there's some user-contributed Augeas examples in a Puppet wiki > somewhere, but I haven't been able to find them. Any pointers > appreciated. > > > regards > > > Andrew > > -- > 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. -- 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.
