Peter Berghold
2012-Feb-03 15:54 UTC
[Puppet Users] Interesting permissions issue with nagios_* providers
Hi folks, I noticed an interesting problem with the nagios_* providers especially in Debian. Besides writing to the wrong file (I fixed that issue) I''ve noticed there is a umask issue where the config files end up being owned by root with perms 0640. This causes nagios to spit milk out of its nose because it cannot read the configuration files. I came up with a kludgey solution to the problem but I''m not happy with it. Anybody out there run into this and fixed it? I''m curious to see what others came up with to fix this. For those that are curious as to how I fixed the "wrong file" problem I came up a solution where in my site.pp file I have the following: if ( $operatingsystem == "Debian ) { Nagios_host { target => "/etc/nagios3/conf.d/puppet_hosts.pp" } --- etc --- } -- Peter L. Berghold Owner, Shark River Technical Solutions LLC -- 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.
windowsrefund
2012-Feb-03 16:40 UTC
[Puppet Users] Re: Interesting permissions issue with nagios_* providers
The trick is to export a file resource which matches the target parameter of the Nagios_ type. The exported file resource should require the Nagios_ resource so everything works upon collection. I''m actually writing an article for Linux Journal on this exact issue :) Adam -- 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.
Gabriel Filion
2012-Feb-03 16:41 UTC
Re: [Puppet Users] Interesting permissions issue with nagios_* providers
On 12-02-03 10:54 AM, Peter Berghold wrote:> I noticed an interesting problem with the nagios_* providers especially > in Debian. Besides writing to the wrong file (I fixed that issue) I''ve > noticed there is a umask issue where the config files end up being owned > by root with perms 0640. This causes nagios to spit milk out of its > nose because it cannot read the configuration files. > > I came up with a kludgey solution to the problem but I''m not happy with > it. Anybody out there run into this and fixed it? I''m curious to see > what others came up with to fix this. > > For those that are curious as to how I fixed the "wrong file" problem I > came up a solution where in my site.pp file I have the following: > > if ( $operatingsystem == "Debian ) { > Nagios_host { target => "/etc/nagios3/conf.d/puppet_hosts.pp" } > --- etc --- > }yes, you do need to set the target on nagios resources. In order to let different nagios servers be installed with different OSes (weird idea, I know, but hey! anything''s possible ;) ), you could set that target on resource collection: Nagios_command <||> { target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_command.cfg", # ... } also, for the permissions, you could use a file resource with the same path to set permissions (but not the contents). check out this module for examples (have a look at manifests/base.pp): https://labs.riseup.net/code/projects/shared-nagios -- Gabriel Filion -- 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.
windowsrefund
2012-Feb-03 16:45 UTC
[Puppet Users] Re: Interesting permissions issue with nagios_* providers
The trick is to export a file resource which matches the target parameter of the Nagios_ type. The exported file resource should require the Nagios_ resource so everything works upon collection. I''m actually writing an article for Linux Journal on this exact issue :) Adam -- 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.