Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've been Googling around and haven't seen any examples of a more complex hieradata yaml config. Consider this:

# /path/to/hieradata/vhost/config.yaml
vhost_config_melikedev:
  port: 53002
  framework: wordpress
  static_asset_dirs:
    - wp-content

vhost_config_melikedrinks:
  port: 53001
  framework: symfony
  static_asset_dirs:
    - image
    - js
    - css

How would I access the port value for the vhost_config_melikedev entry?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Thanks to the guys in #puppet on irc.freenode.net. You can do what I was asking by referencing the values like this:

#/path/to/modules/nginx/manifests/vhost/conf.pp
define touch($app_primary, $app_sub) {

    ....

    $vhost_config_data = hiera("vhost_config_${name}")

    $tpl_port = $vhost_config_data[port]

    ....
}

You can also reference the values using the info outlined here: https://ask.puppetlabs.com/question/271/a-heira-example-with-complicated-data/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.