Hello everybody,

I'm testing Puppet 3.2 and Hiera (installed with http://apt.puppetlabs.com) 
on Debian Wheezy. Here is my "/etc/puppet/manifests/site.pp" file :

-------------------------------------------------------
stage { "one": }
stage { "two": }
Stage['one'] -> Stage['two']
hiera_include('classes')
-------------------------------------------------------

Here is the "init.pp" file of my "one" module :

-------------------------------------------------------
class one  ($stage = "one") {

    notify {"Class one is done":
        message => "Class one is loaded."
    }

}
-------------------------------------------------------

And here is the "init.pp" file of my "two" module :

-------------------------------------------------------
class two ($stage = "two") {

    if tagged("one") {
        $var = "YES"
    }
    else {
        $var = "NO"
    }

    notify {"Class two is done":
        message => "The value of var is $var."
    }

}
-------------------------------------------------------

If I use this yaml file for my host :


-------------------------------------------------------
---
classes:
  - one
  - two
-------------------------------------------------------

then everything is ok ($var == "YES") :

-------------------------------------------------------
# puppet agent --test
Info: Retrieving plugin
Info: Caching catalog for shinken.domaine.priv
Info: Applying configuration version '1373027591'
Notice: Class one is loaded.
Notice: /Stage[one]/One/Notify[Class one is done]/message: defined 
'message' as 'Class one is loaded.'
Notice: The value of var is YES.
Notice: /Stage[two]/Two/Notify[Class two is done]/message: defined 
'message' as 'The value of var is YES.'
Notice: Finished catalog run in 0.16 seconds
-------------------------------------------------------

*But* if I use this yaml file for my host (change the order):

-------------------------------------------------------
---
classes:
  - two
  - one
-------------------------------------------------------

then $var == "NO" :

-------------------------------------------------------
# puppet agent --test
Info: Retrieving plugin
Info: Caching catalog for shinken.domaine.priv
Info: Applying configuration version '1373027591'
Notice: Class one is loaded.
Notice: /Stage[one]/One/Notify[Class one is done]/message: defined 
'message' as 'Class one is loaded.'
Notice: The value of var is NO.
Notice: /Stage[two]/Two/Notify[Class two is done]/message: defined 
'message' as 'The value of var is NO.'
Notice: Finished catalog run in 0.12 seconds
-------------------------------------------------------

Yet, with "Stage['one'] -> Stage['two']", the classed are loaded in the 
good order.

1) Is it normal ?

2) I would like to have $var == "YES" whatever the order of classes in the 
yaml file. Is it possible ?

Thanks in advance.


--
François Lafont





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