Os
2010-12-29 08:07:20 UTC
Hello,
I am still not getting warm with augeas and puppet, there are some
things I do not understand. At the moment I am trying the following:
- I want to set some kernel parameters in the /etc/sysctl.conf file
- in one puppet module, I have defined some default values for the
kernel parameters
- but for several servers I want to modify some of these values,
therefore I would like to overwrite the default value via the custom
module of these servers
Here is an fictitious example:
####################################################
1. puppet module with the default value:
####################################################
...
augeas {"default-sysctl.conf":
provider => "augeas",
context => "/files/etc/sysctl.conf",
changes => [
"set fs.aio-max-nr 1048576",
"set fs.file-max 9000",
],
notify => Exec["load-sysctl"],
onlyif => "match #comment[1] != 'MODIFY_FLAG'",
}
exec { "load-sysctl":
command => "/sbin/sysctl -p",
refreshonly => true,
}
...
####################################################
2. custom puppet module to adjust adjusted value:
####################################################
augeas {"custom-sysctl.conf":
provider => "augeas",
context => "/files/etc/sysctl.conf",
changes => [
"set fs.file-max 3000",
],
notify => Exec["load-sysctl"],
}
My problem is now the "match"-constraint. I would like to set a
comment in the /etc/sysctl.conf file to tell augeas/puppet that the
file will be configured via an other module.
So I want to match if this comment is present or not. I have tried
several combinations, at the moment I wrote the MODIFY_FLAG comment on
top of the file. But none of these worked.
When I rebuild this in augtool, it works fine:
augtool> match /files/etc/sysctl.conf/#comment[1] MODIFY_FLAG
I am using the following software:
- puppet 0.25.5
- augeas 0.7.4
- augeas-libs 0.7.4
- ruby-augeas 0.3.0
But perhaps I am doing the whole thing wrong, is there an other way to
solve this default-custom thing?
I am still not getting warm with augeas and puppet, there are some
things I do not understand. At the moment I am trying the following:
- I want to set some kernel parameters in the /etc/sysctl.conf file
- in one puppet module, I have defined some default values for the
kernel parameters
- but for several servers I want to modify some of these values,
therefore I would like to overwrite the default value via the custom
module of these servers
Here is an fictitious example:
####################################################
1. puppet module with the default value:
####################################################
...
augeas {"default-sysctl.conf":
provider => "augeas",
context => "/files/etc/sysctl.conf",
changes => [
"set fs.aio-max-nr 1048576",
"set fs.file-max 9000",
],
notify => Exec["load-sysctl"],
onlyif => "match #comment[1] != 'MODIFY_FLAG'",
}
exec { "load-sysctl":
command => "/sbin/sysctl -p",
refreshonly => true,
}
...
####################################################
2. custom puppet module to adjust adjusted value:
####################################################
augeas {"custom-sysctl.conf":
provider => "augeas",
context => "/files/etc/sysctl.conf",
changes => [
"set fs.file-max 3000",
],
notify => Exec["load-sysctl"],
}
My problem is now the "match"-constraint. I would like to set a
comment in the /etc/sysctl.conf file to tell augeas/puppet that the
file will be configured via an other module.
So I want to match if this comment is present or not. I have tried
several combinations, at the moment I wrote the MODIFY_FLAG comment on
top of the file. But none of these worked.
When I rebuild this in augtool, it works fine:
augtool> match /files/etc/sysctl.conf/#comment[1] MODIFY_FLAG
I am using the following software:
- puppet 0.25.5
- augeas 0.7.4
- augeas-libs 0.7.4
- ruby-augeas 0.3.0
But perhaps I am doing the whole thing wrong, is there an other way to
solve this default-custom thing?
--
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.
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.