On Apr 16, 1:45 am, Jonathon Anderson <anderbub...@gmail.com> wrote:
> I have a `sysctl::variable` defined type that creates files in
> `/etc/sysctl.d`.  Some operating systems (*cough*SLES10*cough*) don't read
> sysctl settings from `/etc/sysctl.d`, though, and expect all settings to be
> in a single file, `/etc/sysctl.conf`.  For such operating systems, I'd like
> to define the content of that file with a template that references the
> values of the `sysctl::variable`s.
>
> In the Puppet DSL I can collect all fragments with language like
> `Sysctl::Variable<| |>`.  How can I do something similar in a template such
> that I can access the variable names and values?  For example:

Have you considered instead using something like the "file fragment
pattern"? Basically, you add 'notifiy' to sysctl::variable resources
to notify an exec that rebuilds sysctl.conf from sysctl.d (basically
"cat /etc/sysctl.d/*.conf > /etc/sysctl.conf").

http://projects.puppetlabs.com/projects/puppet/wiki/Generating_a_config_file_from_fragments

(I'm not sure the special concatenation script is really necessary;
you can have the exec notify the service to reload if necessary and
the 'for' loop is unnecessary with shell wildcards. At least, that's
how we do it at work.)

Wil

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

Reply via email to