Yes nice.. its work thank you Dominic, but its still execute even its
already changed its normal for new augeas? because for old augeas not
trying to change if already change. "returns: executed successfully"
my onlyif doesn't work. onlyif => "match
*[/files/etc/modprobe.conf[install = '$module /bin/true']] size == 0",
and this script doesn't work anymore:
if $ssh_port != '' {
augeas { "ssh_port" :
context => "/files/etc/ssh/sshd_config",
changes => [
"set Port $ssh_port",
],
notify => Service[
"sshd"
],
}
}
Thank you for any help.
Regards,
On 05/01/2012 08:06 PM, Dominic Cleal wrote:
On 01/05/12 13:00, heriyanto wrote:
Hi ,
This my puppet class, working nicely. But after i upgarde augeas into
augeas-0.10.0-3
There was an incompatible change to the modprobe lens in Augeas 0.10.0:
"Modprobe: Parse commands in install/remove stanzas (this introduces a
backwards incompatibility)"
from http://augeas.net/news.html
define modprobe::disableModule ( $module = '' )
{
augeas::basic-change {"$name":
file => "/etc/modprobe.conf",
lens => "modprobe.lns",
changes => "set install[0] '$module /bin/true'",
onlyif => "match *[/files/etc/modprobe.conf[install =
'$module /bin/true']] size == 0",
}
}
The value of the node is no longer a concatenation of the module name
and the command, the two were split up. Try this:
define modprobe::disableModule ( $module = '' )
{
augeas::basic-change {"$name":
file => "/etc/modprobe.conf",
lens => "modprobe.lns",
changes => [
"set install[.='$module'] '$module'",
"set install[.='$module']/command /bin/true",
],
}
}
This creates two nodes instead of just the one, e.g.
/files/etc/modprobe.conf/install = "foo"
/files/etc/modprobe.conf/install/command = "/bin/true"
I've also changed the install[0] so it doesn't always overwrite the
first install line and instead creates an install line per module.
Cheers,
--
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.