On Tue, Aug 14, 2012 at 6:09 AM, jcbollinger <john.bollin...@stjude.org> wrote:
>
>
> On Tuesday, August 14, 2012 12:12:33 AM UTC-5, Douglas wrote:
>>
>> Trying to force puppet class execution order with:
>>
>> Class['lvm'] -> Class['network'] -> Class['apt'] -> Class <| |>
>>
>> This is giving me:
>>
>> err: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Resource type class doesn't exist at
>> /truth/sauce/env/prod/modules/role/manifests/common.pp:37 on node
>> testweb07.us1.xxx.com
>> warning: Not using cache on failed catalog
>>
>> I did have it working with run stages, but when trying to also use the
>> relationship syntax with the following in site.pp
>>
>> Apt::Source <| |> -> Exec["apt-update"]
>> Exec['apt-update'] -> Package <| |>
>>
>> got the dreaded cyclic dependency errors... :(
>
>
>
> Yes, both run stages and chaining from/to collections are prone to causing
> cycles.  They have their uses, but you do need to think very carefully about
> how you use them.  Moreover, the more you use them, the more likely you are
> to have trouble.  It is often quite hard to make correct blanket statements
> about resource relationships, more so the more complex your manifests
> become.
>
> It looks and sounds as if you are trying to re-express your stages-based
> manifests using resource chaining.  If that's the case then you are on a
> wild goose chase.  Declaring the same relationships via a different syntax
> must necessarily produce the same cycle(s).  To fix the problem you need to
> remove (the right) unneeded relationships.

Not really. I have three run stages that have been working fine. It
was when I tried to add

Apt::Source <| |> -> Exec["apt-update"]
Exec['apt-update'] -> Package <| |>

to site.pp to globally enforce apt source installs, an apt-get update
and then installation of packages, in that order, that the dependency
cycles started. I thought maybe mixing the two was bad, which was when
I tried replacing the run stages with Class->, which doesn't seem to
be allowed syntactically btw. Looks like a bug?

I could put the installation of apt sources in their own run stage
that runs first. However, different classes of servers need different
apt sources, and therefore I need the ability to be able to add apt
sources at arbitrary points after the initial run stage, yet still
ensuring that an apt-get update happens only once after all the apt
sources have been installed, but before any packages are installed.

This must be a general problem. Wonder how people have solved it...?

Doug.

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