On Tuesday, August 14, 2012 11:37:26 AM UTC-5, Douglas wrote:
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?
There is no inherent problem with mixing stages and chaining, as far as I
know. Both are simply facades on top of Puppet's underlying relationship
machinery, so fundamentally they are parts of the same thing.
I am pretty confident that the problem is with Class<| |>. There are at
least two factors in play there:
1. Classes are not resources. PL has made a concerted effort since the
introduction of v. 2.6 to blur, downplay, and obscure the distinction, but
they have not removed it.
2. Resource collections are conflated with realization of virtual
resources (or collection of exported resources, where there isn't even a
distinct name for the concept). There is a longstanding ticket on this
issue.
Since classes are not resources, but collection syntax specifies, in part,
realization of virtual resources of the specified type, I do not find it
surprising that Puppet rejects Class<| |>. It looks like it should work
(because PL has done a good job of making classes appear to be resources),
but I'm not surprised that it doesn't. I would not consider that a bug per
se, but that it should work as you expected seems a reasonable feature
request.
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...?
I agree that the problem seems general. Does it not work to put your
Apt::Source resources into their own classes, and assign those classes to
your initial stage? That seems the natural solution.
John