Use a puppet or hiera variable in hiera

24 views
Skip to first unread message

Ugo Bellavance

unread,
Sep 29, 2016, 11:35:47 AM9/29/16
to Puppet Users
Hi,

Is it possible to have an array in hiera (or puppet) and use it in hiera?

For example:

clients:
  - client1
  - client2

Then,

nginx::nginx_vhosts:
  "%{hiera('clients')}":
    ensure: present



It would be the equivalent of having:

nginx::nginx_vhosts:
  'client1':
    ensure: present

nginx::nginx_vhosts:
  'client2':
    ensure: present

In this article (https://blog.serverdensity.com/deploying-nginx-with-puppet/), they declare a variable (vdomain) and then use it, but I tried with an array and it doesn't work.

Thanks,

Peter Faller

unread,
Sep 30, 2016, 3:17:50 AM9/30/16
to Puppet Users
Have you considered using an external node classifier instead? 

Ugo Bellavance

unread,
Sep 30, 2016, 8:00:55 AM9/30/16
to Puppet Users
On Friday, September 30, 2016 at 3:17:50 AM UTC-4, Peter Faller wrote:
Have you considered using an external node classifier instead? 
I use The Foreman on my older 2.7 puppet master, but only for reporting purposes.  I think I may not good enough with puppet to use an ENC. I'm not on puppet full-time.
Reply all
Reply to author
Forward
0 new messages