Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to parse json hash or array when called with hiera() #6

Merged
merged 1 commit into from
Sep 28, 2014

Conversation

jumanjiman
Copy link
Contributor

Attempt to parse a string as json when called by hiera() to
improve hiera-etcd compatibility with yaml backend. Fall back
to native string if the string does not contain json.

Use case:

It should be possible to use both etcd and yaml backends with
a given puppet repo and the hiera() function to return a complex
data structure.

  • hiera() returns first match and can be an array, hash, or string
  • hiera_array() does a concat and may not be desired
  • hiera_hash() does a deep merge and may not be desired

Attempt to parse a string as json when called by hiera() to
improve hiera-etcd compatibility with yaml backend. Fall back
to native string if the string does not contain json.

Use case:

It should be possible to use both etcd and yaml backends with
a given puppet repo and the hiera() function to return a complex
data structure.

* hiera() returns first match and can be an array, hash, or string
* hiera_array() does a concat and may not be desired
* hiera_hash() does a deep merge and may not be desired
@garethr
Copy link
Owner

garethr commented Sep 28, 2014

Thanks, makes sense to me

garethr added a commit that referenced this pull request Sep 28, 2014
Attempt to parse json hash or array when called with hiera()
@garethr garethr merged commit 9b56b6d into garethr:master Sep 28, 2014
jumanjiman added a commit to jumanjiman/docker-puppet that referenced this pull request Sep 28, 2014
jumanjihouse#10 switched
the url to my fork of hiera-etcd.

garethr/hiera-etcd#6 has been merged, so
it's better imho to use the upstream url to ensure we always have
the latest version of hiera-etcd.
@jumanjiman jumanjiman deleted the json branch September 28, 2014 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants