The issue is that I don't know the exact names of all the nagios_hosts
ahead of time, so I can't declare file resources explicitly, each host
has it's own host file.

So I've tried declaring a "file" resource for the directory that the
nagios_host files get deposited in and using "recurse" to set the
permissions on all the files in the directory but I get an error in
puppet saying I have a circular dependency, I'm assuming because the
"nagios_host" type explicitly sets permissions on the files.

I've tried using "exec" but I need to make sure the exec gets called
after all the nagios_hosts are collected otherwise it's pointless but
how do you tell the exec command to run after the collection?

I've tried setting a "before" parameter in the exported @@nagios_host
resource but puppet gave me an error when I tried to use the "title"
of the exec instead of the command.  I haven't tired using the exec
command itself in the "before" parameter because it has switches, i.e.
"chmod 644 /etc/nagios3/hosts/*", and I thought it would cause
problems with spaces and it looks messier as well.  I don't mind doing
that, though, if it works.

Cheers,
Scott

On Jan 22, 5:25 pm, Peter Meier <peter.me...@immerda.ch> wrote:
> Hi,
>
> > Hi, so I'm exporting a nagios_host type that gets collected by the
> > nagios server and each host has it's own file, however, when each host
> > file is written, it's only readable by root.  How can I make all the
> > files mode 644 when they're written?  Or how would I go about using
> > the "file" type to make sure that all the files in a dir are mode
> > 644?  Thanks.
>
> you can define a file resource to manage these files and set the  
> appropriate modes in this resource.
>
> have a look @ how I do it on:  
> https://git.puppet.immerda.ch/?p=module-nagios;a=blob;f=manifests/ini...from 
> line 83  
> on.
>
> cheers pete
--~--~---------~--~----~------------~-------~--~----~
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