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

hiera-eyaml doesn't play nice with heira_hash() 3.2.3 #65

Closed
larryfast opened this issue Feb 6, 2014 · 9 comments
Closed

hiera-eyaml doesn't play nice with heira_hash() 3.2.3 #65

larryfast opened this issue Feb 6, 2014 · 9 comments

Comments

@larryfast
Copy link

I just started evaluating hiera-eyaml and hit a glitch. It seems that any attempt to read a hash in an eyaml file using hiera_hash(), produces an error:
"Error 400 on SERVER: Resolution type is hash but parsed_answer is a Hash" The error occurs even if the hash does not contain any encrypted values. One more detail:

  • hiera( 'somehash' ) works fine
  • hiera_hash( 'somehash' ) fails

I'm using heira-eyaml 2.0.0 on puppet 3.2.3. Has anyone seen this before?

The following code snippets should reproduce the problem:

file: my_hiera.eyaml
somehash:
foo: this is just a string

code:
$a = hiera( 'somehash') # This succeeds
$b = hiera_hash('somehash') # This fails

@larryfast
Copy link
Author

I upgraded my server to 3.4.2 and hiera_hash() still fails.

quixoten added a commit to quixoten/hiera-eyaml that referenced this issue Feb 15, 2014
This is an attempt to get deep_merge's working, which are currently
throwing exceptons in my testing environment. See [this
issue](voxpupuli#65).

I copied the yaml_backend from hiera v1.2.1, which is the one used in
puppet v3.4.2, and injected the decryption mechanics. I also needed to
copy the `parse_answer` method from the `::Hiera::Backend` and modified
it to use the decryption aware version of `parse_string`. It's still an
unfortunately long implementation considering that the only real
difference between the eyaml backend and the yaml backend is the change
to `::Heira::Backend.parse_string` that allows it to process encrypted
values.

I feel like this backend could be trimmed down so that it inherits from
the yaml backend, but the issues with doing that are tricky enough to
solve that I'm not going to pursue it at this point.
quixoten added a commit to quixoten/hiera-eyaml that referenced this issue Feb 17, 2014
This is an attempt to get deep_merge's working, which are currently
throwing exceptons in my testing environment. See [this
issue](voxpupuli#65).

I copied the yaml_backend from hiera v1.2.1, which is the one used in
puppet v3.4.2, and injected the decryption mechanics. I also needed to
copy the `parse_answer` method from the `::Hiera::Backend` and modified
it to use the decryption aware version of `parse_string`. It's still an
unfortunately long implementation considering that the only real
difference between the eyaml backend and the yaml backend is the change
to `::Heira::Backend.parse_string` that allows it to process encrypted
values.

I feel like this backend could be trimmed down so that it inherits from
the yaml backend, but the issues with doing that are tricky enough to
solve that I'm not going to pursue it at this point.
@quixoten
Copy link
Contributor

@larryfast, my current master is working for me with puppet 3.4.2. You're welcome to test it out. Just clone the repo and build/install it yourself, i.e.

cd /tmp
git clone https://github.com/devin-c/hiera-eyaml.git
cd hiera-eyaml
bundle
bundle exec rake install

Let me know if you run into issues.

quixoten added a commit to quixoten/hiera-eyaml that referenced this issue Feb 17, 2014
This is an attempt to get deep_merge's working, which are currently
throwing exceptons in my testing environment. See [this
issue](voxpupuli#65).

I copied the yaml_backend from hiera v1.2.1, which is the one used in
puppet v3.4.2, and injected the decryption mechanics. I also needed to
copy the `parse_answer` method from the `::Hiera::Backend` and modified
it to use the decryption aware version of `parse_string`. It's still an
unfortunately long implementation considering that the only real
difference between the eyaml backend and the yaml backend is the change
to `::Heira::Backend.parse_string` that allows it to process encrypted
values.

I feel like this backend could be trimmed down so that it inherits from
the yaml backend, but the issues with doing that are tricky enough to
solve that I'm not going to pursue it at this point.
quixoten added a commit to quixoten/hiera-eyaml that referenced this issue Feb 17, 2014
This is an attempt to get deep_merge's working, which are currently
throwing exceptons in my testing environment. See [this
issue](voxpupuli#65).

I copied the yaml_backend from hiera v1.2.1, which is the one used in
puppet v3.4.2, and injected the decryption mechanics. I also needed to
copy the `parse_answer` method from the `::Hiera::Backend` and modified
it to use the decryption aware version of `parse_string`. It's still an
unfortunately long implementation considering that the only real
difference between the eyaml backend and the yaml backend is the change
to `::Heira::Backend.parse_string` that allows it to process encrypted
values.

I feel like this backend could be trimmed down so that it inherits from
the yaml backend, but the issues with doing that are tricky enough to
solve that I'm not going to pursue it at this point.
quixoten added a commit to quixoten/hiera-eyaml that referenced this issue Feb 19, 2014
This is an attempt to get deep_merge's working, which are currently
throwing exceptons in my testing environment. See [this
issue](voxpupuli#65).

I copied the yaml_backend from hiera v1.2.1, which is the one used in
puppet v3.4.2, and injected the decryption mechanics. I also needed to
copy the `parse_answer` method from the `::Hiera::Backend` and modified
it to use the decryption aware version of `parse_string`. It's still an
unfortunately long implementation considering that the only real
difference between the eyaml backend and the yaml backend is the change
to `::Heira::Backend.parse_string` that allows it to process encrypted
values.

I feel like this backend could be trimmed down so that it inherits from
the yaml backend, but the issues with doing that are tricky enough to
solve that I'm not going to pursue it at this point.
@larryfast
Copy link
Author

Thanks for the update. Unfortunately I only have a 'runtime' environment. For example bundle doesn't seem to exist on my system and yum search bundle didn't turn up anything. I'd like to try your fix. Suggestions on how to proceed?

@quixoten
Copy link
Contributor

Try gem install bundler to get the bundle command.

@larryfast
Copy link
Author

OK. I don't mean to be rude but I dare not run gem. We've had terrible problems mixing packages managed with gem and others managed with RPM. I'll see if I can track down the RPM'd version of bundler.

@sihil sihil added the duplicate label Mar 3, 2014
@sihil
Copy link
Collaborator

sihil commented Mar 3, 2014

I'm going to mark this as a duplicate until proven otherwise. We'll try and get a gem cut by the end of the week that includes this PR @larryfast

@larryfast
Copy link
Author

I'm going to mark this as a duplicate until proven otherwise. 
Sounds good. I will test it as soon as the gem is available. Unfortunately I'm not setup to build from the repo.
LF

@sihil
Copy link
Collaborator

sihil commented Mar 26, 2014

The @larryfast - have you had a chance to test this against v2.0.1?

@larryfast
Copy link
Author

Tested eyaml 2.0.1 with hiera_hash and seems to be working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants