Resource ordering with Hiera ENC

60 views
Skip to first unread message

Raul Macian

unread,
Apr 17, 2015, 10:57:25 AM4/17/15
to puppet...@googlegroups.com
Hi There,

After a couple of years working with puppet I'm starting to use Hiera as ENC with the hiera_include('classes').

Now I'm having problems with the resource ordering. I created a module to set up my repos and then use some others modules. My problem is that my 'common' module must run before the other modules and I don't know how to do it in hiera.

My yaml is like

## YAML
---
classes
:
 
- common
 
- ntp
 
- zabbix::agent



But this drives me to

Info: Applying configuration version '1429274932'
Notice: /Stage[main]/Zabbix::Agent/Package[zabbix-agent]/ensure: current_value absent, should be 2.4.3-1.el6 (noop)
Notice: /Stage[main]/common::Repos/Yumrepo[zabbix]/ensure: current_value absent, should be present (noop)

How do I force to the common class to have procedence over the zabbix module?  Before using hiera as ENC I would have a -> between the classes and an anchor if needed in my manifest, but now I don't have any manifest for my nodes. Where can I put it on ?



Raul Macian

unread,
Apr 17, 2015, 11:26:31 AM4/17/15
to puppet...@googlegroups.com
I have solved it as below with a wrapper to the zabbix module:

class common::zabbix {

 contain zabbix
::agent

 
Class['common::repos'] -> Class['common::zabbix']
 
}

and then in selected yaml environments

## YAML
---
classes
:
 
- common
 
-
ntp
 
- common::zabbix
Reply all
Reply to author
Forward
0 new messages