Unfortunatelly, stages is absolutely useless because of strict limitations 
(notify between stages, only classes), and I can't use one script because 
of ifup|ifdown commands and interfaces file is in different modules.

I have a defined type with ifup/ifdown commands for specified interface. 
Something like this:

define iface ( $iface ) {
 exec {"ifdown $iface": }
 exec {"ifup $iface": }
}

And command in some class, which rewrite /etc/network/interfaces. Something 
like

exec {'rewrite interfaces': }

I need to do ifdown for all interfaces before rewrite configuration, and 
ifup - after. Ok, I've add to the end of my iface defined type:

Exec["ifdown $iface"] ~> Exec['rewrite interfaces'] ~> Exec["ifup $iface"]

And I need to tell Puppet not to put at least any File and Service 
resources between ifdown and ifup, because there network is unreachable. 
Services I can put after all ifup with <| |>, but files isn't so simple and 
must be before ifdown and after ifup. So I can't fix a problem with simple 
relationships and look for a solution.


вторник, 9 июля 2013 г., 17:48:45 UTC+4 пользователь Erik Dalén написал:
>
> Putting them in a separate stage is also a possibility.
>
>
> On 9 July 2013 15:34, David Schmitt <da...@dasz.at <javascript:>> wrote:
>
>> On 09.07.2013 14:01, Nevorotin Vadim wrote:
>>
>>> I need to apply three resources one immediatelly after another. It's a
>>> ifdown/ifup commands, and command to generate /etc/network/interfaces
>>> file. I need to do ifdown, then rebuild interfaces, then ifup. I try to
>>> add simple relationship, but in this case some File resources are trying
>>> to be applied between ifdown and ifup. So they can't connect to Puppet
>>> master to verify source and generate an error. How can I fix it?
>>>
>>
>> In such a case it is best to put all commands into a script and run that. 
>> That also has the upside, that you can protect the complete network restart 
>> with a single refreshonly/notify pair.
>>
>>
>> Regards, David
>>
>>
>> -- 
>> 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 puppet-users...@googlegroups.com <javascript:>.
>> To post to this group, send email to puppet...@googlegroups.com<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/puppet-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> -- 
> Erik Dalén 
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to