Wow, Christopher gave an exhaustive answer :-)
I'll try and Keep It Simple.
On 06/18/2014 04:22 PM, Sergey Arlashin wrote:
> I do need to have 2 separate modules. I need the class 'testmode' to run
> before class 'test mod::nginxtest'. And I need to restart service 'nginx'
> when I change '/tmp/nginx.test'.
Yes, you face the same issue, seeing as you just brought it in a
different notation. The same relationships are established.
> So then the question is - how to do this properly? Do I need to create
> something like exec { 'nginx restart': ... } ?
This is actually not possible.
If Puppet should refresh the service upon change of the config file, it
*must* evaluate the file resource before the service resource.
You need to disentangle your relationships and come up with an order in
which you want your resources applied, e.g.
Package -> File -> Service
This may indeed mean that you cannot require a whole class. But as
Christopher has advised, you mileage may increase if you structure the
classes more distinctly.
HTH,
Felix
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/53A1AA93.9000708%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.