On Jan 22, 2009, at 4:55 PM, Scott wrote:

> 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.

It does not, so I don't see why you'd get a cycle.  What does the  
cycle say?

>
> 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?

Well, you could have each nagios instance require the exec, but that  
would be messy.

>
> 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.


Nah, if the relationship to the title doesn't work, the relationship  
to the command won't.

This is obviously something I just didn't really think about when  
developing this stuff.  However, based on how Puppet works ATM, you  
should not have to worry about it beyond the first run.  If you set  
the perms correctly, then Puppet will retain them afterward.

Really, though, managing the perms with 'file' statements should work.

-- 
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
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