Hi,

I'm just starting to use create_resources and hash merging which I have 
working but I'm not sure how I can avoid duplicating some of the hash 
values further up in the hierarchy.

For example:

- I have set :merge_behavior: deeper and installed the deep_merge gem
- I'm using the eyaml backend

# hiera.yaml (partial)
:hierarchy:
  - "node/%{::fqdn}"
  - "%{::environment}"
  - "%{::location}"
  - "%{::flavour}"
  - common


# common.eyaml
 ---
windows_webconfig:
  website1:
    name: MyWebSiteExample
    32_bit: false
    pipeline_mode: Integrated
    runtime_version: v4.0
    root_web_folder: 'd:\webroot'
    bindings:
      -
        port: 80
        host_header: dan.local.com
        ip_address: *
        protocol: http 
  website2:
    name: MyWebSiteExample2
    32_bit: false
    pipeline_mode: Integrated
    runtime_version: v4.0
    root_web_folder: 'd:\webroot'
    bindings:
      -
        port: 80
        host_header: dan.somewhere.com
        ip_address: *
        protocol: http 


Now what I'd like to do is only update the bindings for particular 
environments and not have to duplicate the whole hash, something like this:

# uat.eyaml
---
windows_webconfig:
  website1:
     bindings:
      -
        port: 80
        host_header: dan.uat.com
        ip_address: *
        protocol: http 
  website2:
     bindings:
      -
        port: 80
        host_header: dan.uat.com
        ip_address: *
        protocol: http 
 


The above (uat.eyaml) doesn't work unless I replicate the whole hash so I 
was wondering if this is by design of the merging and if there is another 
way I can achieve my aim of not duplicating the site definitions.  I 
experimented with separating the "bindings" out into a separate hash and 
passing this into create_resources but it's kind of messy and doesn't work 
very well.

Thanks in advance.

Dan


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9936a2a4-0dd7-44ec-b286-919b999448a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to