it seems there is a bug in puppet --graph, that misses some dependencies.
https://tickets.puppetlabs.com/browse/PUP-2075
so, this code actually works as expected:
class { c3: }
class c1 {
exec { exec1: command => '/bin/echo exec1; exit 1' }
}
class c2 {
* # include c1*
* contain c1*
exec
My colleague Guillaume showed me a possible implementation of the anchor
pattern:
class { c2: }
->
class { c3: }
class c1 {
notice "+++"
anchor {'before_c1':}
->
file {'/tmp/c1.txt': ensure => present }
->
anchor {'after_c1':}
}
class c2 {
include c1
notice "+++"
anchor {'be
I've even simplified the example:
class { c2: }
class { c3: }
class c1 {
notice "+++"
file {'/tmp/c1.txt': ensure => present }
}
class c2 {
# include c1
contain c1
notice "+++"
file {'/tmp/c2.txt': ensure => present }
}
class c3 {
require c2
notice "+++"
file {'/tmp/c3.txt': en
I've even simplified the example:
class { c3: }
class c1 {
notice "+++"
file {'/tmp/c1.txt': ensure => present }
}
class c2 {
# include c1
contain c1
notice "+++"
file {'/tmp/c2.txt': ensure => present }
}
class c3 {
# include c2
contain c2
notice "+++"
file {'/tmp/c3.txt': en
I've tried the anchor pattern as follows:
class { c2: }
class { c3: }
class c1 {
}
class c2 {
class { c1: }
anchor { 'c1_first': } -> Class['c1'] -> anchor { 'c1_last': }
}
class c3 {
require c2
}
but still puppet apply --graph test.pp shows that c3 does not depend on c1.
so, how to appl
I still don't understand much the anchor pattern.
could you please modify the previous example to use the anchor pattern?
On Wednesday, March 19, 2014 12:22:31 PM UTC+1, Jose Luis Ledesma wrote:
>
> Works as expected
>
> You have to use contain if version> 3.4 or anchor pattern
> http://docs.pupp
Works as expected
You have to use contain if version> 3.4 or anchor pattern
http://docs.puppetlabs.com/puppet/latest/reference/lang_containment.html
El 19/03/2014 12:18, "David Portabella"
escribió:
> class { c2: }
> class { c3: }
>
> class c1 {
> }
>
> class c2 {
> class { c1: }
> }
>
> clas
class { c2: }
class { c3: }
class c1 {
}
class c2 {
class { c1: }
}
class c3 {
require c2
}
c3 depends on c2 (as expected), but c3 does not depend on c1.
this issue could be fixed by adding "require c1" inside c3.
however, in a general case, I don't know what is instantiated inside c2.
wh