Skip to content

Commit

Permalink
make eyaml be the first backend
Browse files Browse the repository at this point in the history
older versions of this module had eyaml listed as the first
backend. people who use eyaml need eyaml as the first back end,
otherwise the encrypted valued will be read in as plain yaml and never
decrypted.

closes #161
  • Loading branch information
mmckinst committed Oct 13, 2016
1 parent 3d46be2 commit ce7c185
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@
true => $datadir,
}
# the requested_backends has a side affect in that the eyaml will always be
# last for backend lookups. This can be fixed by specifing the order in
# first for backend lookups. This can be fixed by specifing the order in
# the backends parameter ie. ['yaml', 'eyaml', 'redis']
$requested_backends = unique(concat($backends, 'eyaml'))
$requested_backends = unique(concat(['eyaml'], $backends))
} else {
$requested_backends = $backends
$eyaml_real_datadir = undef
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/hiera_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

it 'include backends' do
backends = YAML.load(content)[:backends]
expect(backends).to eq(%w(yaml eyaml json yamll))
expect(backends).to eq(%w(eyaml yaml json yamll))
end
it 'include json backend' do
backend = YAML.load(content)[:json]
Expand Down Expand Up @@ -190,7 +190,7 @@
end
it 'include eyaml-gpg backend with eyaml unspecified' do
backends = YAML.load(content)[:backends]
expect(backends).to eq(%w(yaml eyaml))
expect(backends).to eq(%w(eyaml yaml))
eyaml_backend = YAML.load(content)[:eyaml]
expect(eyaml_backend[:datadir]).to eq('/etc/puppetlabs/code/environments/%{::environment}/hieradata')
expect(eyaml_backend[:encrypt_method]).to eq('gpg')
Expand Down Expand Up @@ -320,7 +320,7 @@

it 'include backends' do
backends = YAML.load(content)[:backends]
expect(backends).to eq(%w(yaml eyaml json yamll))
expect(backends).to eq(%w(eyaml yaml json yamll))
end
it 'include json backend' do
backend = YAML.load(content)[:json]
Expand Down Expand Up @@ -380,7 +380,7 @@
end
it 'include eyaml-gpg backend with eyaml unspecified' do
backends = YAML.load(content)[:backends]
expect(backends).to eq(%w(yaml eyaml))
expect(backends).to eq(%w(eyaml yaml))
eyaml_backend = YAML.load(content)[:eyaml]
expect(eyaml_backend[:datadir]).to eq('/etc/puppetlabs/code/environments/%{::environment}/hieradata')
expect(eyaml_backend[:encrypt_method]).to eq('gpg')
Expand Down

0 comments on commit ce7c185

Please sign in to comment.