Yes, you can do what you want with templates.
This should be enough to get you started.
http://reductivelabs.com/trac/puppet/wiki/PuppetTemplating
On Mon, Sep 7, 2009 at 9:48 PM, ELTigre<igalvarez@gmail.com>
wrote:>
> I have this configuration:
>
> class monit {
> # Installing packages.
> package { "monit":
> ensure => latest;
> }
> file {
> "/etc/default/monit":
> owner => "root",
> group => "root",
> mode => "0644",
> source => "puppet:///monit/etc/default/monit",
> }
> file {
> "/etc/monit/monitrc":
> owner => "root",
> group => "root",
> mode => "0600",
> alias => "monitrc",
> source => "puppet:///monit/etc/monit/monitrc";
> }
> # Starting service.
> service { "monit":
> ensure => running,
> require => File [ "/etc/init.d/monit" ],
> require => File [ "/etc/default/monit" ],
> require => File [ "/etc/monit/monitrc" ],
> subscribe => File [ "monitrc" ];
> }
> BUT, I want to pass some variables to monitrc file when clients get
> tha catalog. I tried to put facter o system variables inside the files
> and did''nt work. My question:
>
> How can I pass variables on files downloading by clients using
> fileserver?
>
> See below the ($variables) I want to pass the monitrc file.
>
> set daemon 60
> set logfile /var/log/monit.log
> set mailserver localhost
> set mail-format { from: monit@($fqdn)}
> set alert ($email_admin)
> set eventqueue basedir /var/monit slots 1000
> set mmonit
> http://monit:qY2zfTeDH6@($mmonit_server):8081/collector
>
> set httpd port 2823 and
> allow monitadmin:kfdos973hs
>
> check system ($fqdn)
> if loadavg (1min) > 4 then alert
> if loadavg (5min) > 2 then alert
> if memory usage > 90% then alert
>
> Is it possible?
>
> Thanks a lot
> regards,
> Israel.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---