voxpupuli / hiera-eyaml

A backend for Hiera that provides per-value asymmetric encryption of sensitive data
MIT License
529 stars 131 forks source link

Error during lookup #2

Closed piotrgo closed 11 years ago

piotrgo commented 11 years ago

Hi, I tried to implement this in my puppet code and I'm getting following error

Debug: hiera(): [eyaml_backend]: Lookup called for key value-encryption-test Debug: hiera(): [eyaml_backend]: Processing datasource: /etc/puppet/hieradata/vm.local.eyaml Error: Could not run: (): could not find expected ':' while scanning a simple key at line 19 column 1

And I assume it's about *.eyaml file which on 19 line has

value-encryption-test: > ENC[Gx7ys+HTjAgPJU7y4xHQloTy8YvFvKIU7pf4Hf8BcKefWbCV2AkxVnUP+NNC NKOsgVpBJhZXx1acULhJg0y7YKvm2e6XjEZPqulb1iU8s5XwVK0HjG0YMsLd 6Bg2wU6lEB/BIVjzjorGmj4RRGW9ZPKTew0LCjFzo7jfTIbvOC4MC0n+OyjV RbXzJoQ8/kQMT/jrnSLRxa9W1xrsEQQqX340A/iKb1O+Lf4FRaby069V2imR EZVSWEvRb2jeEBUb2jrBKB2cXbOBGin2zIZ6ty6bS3+VM1nuC+AYzYTq6wkv wL2mgBYin/JWlSyZ2LRlzB9h3xdZFoVvmzMHSXSJfA==]

I'd appreciate any ideas on what could be wrong here.

Thanks

TomPoulton commented 11 years ago

Judging by the where the debug messages got to it is a problem parsing the eyaml file. Try indenting your encrypted string;

value-encryption-test: > ENC[Gx7ys+HTjAgPJU7y4xHQloTy8YvFvKIU7pf4Hf8BcKefWbCV2AkxVnUP+NNC NKOsgVpBJhZXx1acULhJg0y7YKvm2e6XjEZPqulb1iU8s5XwVK0HjG0YMsLd 6Bg2wU6lEB/BIVjzjorGmj4RRGW9ZPKTew0LCjFzo7jfTIbvOC4MC0n+OyjV RbXzJoQ8/kQMT/jrnSLRxa9W1xrsEQQqX340A/iKb1O+Lf4FRaby069V2imR EZVSWEvRb2jeEBUb2jrBKB2cXbOBGin2zIZ6ty6bS3+VM1nuC+AYzYTq6wkv wL2mgBYin/JWlSyZ2LRlzB9h3xdZFoVvmzMHSXSJfA==]

Yaml is all about the indentation, I think it's how it works out scope

Let me know if that works or if you have more problems

piotrgo commented 11 years ago

You were right, it was just a matter of improper indentation after copy/pasting the encrypted value. It works like a charm now. Thanks!