Comments (10)
I am currently encountering this issue. If the class variable is a hash, hiera-regex does not look for it. Is there going to be a fix for this any time in the near future?
from hiera-regex.
@cleung2010, hiera-regex supports returning hash values, this ticket is for merging multiple hashed values from more than one matched key. If you are not getting any value returned at all there is likely something wrong with your hierarchy, regex, or this is a different bug.
Can you provide more details to reproduce this?
from hiera-regex.
I am using a module called puppet-consul, and there is a class variable named config_hash: https://github.com/solarkennedy/puppet-consul/blob/master/manifests/init.pp
I tried using hiera-regex to fill a key-value pair in that hash like so:
---
- 'localdc[0-9]{1}':
consul::config_hash:
datacenter: 'dc1'
However, the datacenter
value does not seem to appear anywhere after the puppet run.
from hiera-regex.
It might be also worth mentioning that I have config_hash defined in my default.pp (or site.pp). I only want certain KV pairs from configh_hash to be in hiera so it might be because it is, as you pointed out, not doing the merge.
from hiera-regex.
Hey @cleung2010 ,
If you are passing in config_hash then hiera will never look that up or attempt to merge it. Sounds like you don't need hiera hash merging but puppet hash merging. If you have the puppetlabs-stdlib module installed, it supports this. Your class would need to do something like this.
class consul($config_hash) {
$merged_config = merge($config_hash, hiera('consul::config_hash'))
}
Since you don't control the consul class, you could probably just do the merge in site.pp instead.
class {'consul':
config_hash => merge({'somekey' => 'somevalue'}, hiera('consul::config_hash'))
}
from hiera-regex.
What if config_hash is in both common.yaml and hostname.regex, then would that be hiera hash merging? I am planning to remove config_hash from my site.pp and have the common KV values of config_hash in common.yaml
from hiera-regex.
@cleung2010 ,
Yes, that would be hiera hash merging and what this feature would enable. I do not have an ETA when it will be implemented.
from hiera-regex.
Alright, mind if I fork to try to work on it and then send you a pull request?
from hiera-regex.
Not at all, thanks!
from hiera-regex.
Fixed in #4
from hiera-regex.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hiera-regex.