Skip to content

Commit fd0e76c

Browse files
authored
Merge pull request #360 from kenyon/manage-eyaml-config
Manage systemwide eyaml config file
2 parents 350f723 + f9ba22a commit fd0e76c

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

manifests/eyaml.pp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,28 @@
7777
mode => '0644',
7878
require => Exec['createkeys'],
7979
}
80+
81+
file { '/etc/eyaml':
82+
ensure => directory,
83+
owner => 'root',
84+
group => 'root',
85+
mode => '0755',
86+
}
87+
88+
file { '/etc/eyaml/config.yaml':
89+
ensure => file,
90+
owner => 'root',
91+
group => 'root',
92+
mode => '0644',
93+
# https://github.com/voxpupuli/puppet-lint-strict_indent-check/issues/20
94+
# lint:ignore:strict_indent
95+
content => @("CONF"),
96+
---
97+
# This file is managed by puppet.
98+
pkcs7_private_key: ${privkey}
99+
pkcs7_public_key: ${pubkey}
100+
| CONF
101+
# lint:endignore
102+
}
80103
}
81104
}

spec/classes/hiera_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@
8484
it { is_expected.to contain_exec('createkeys').that_requires('Hiera::Install[eyaml]') }
8585
it { is_expected.to contain_file('/dev/null/keys/private_key.pkcs7.pem').with_ensure('file').with_mode('0600').that_requires('Exec[createkeys]') }
8686
it { is_expected.to contain_file('/dev/null/keys/public_key.pkcs7.pem').with_ensure('file').with_mode('0644').that_requires('Exec[createkeys]') }
87+
88+
it do
89+
is_expected.to contain_file('/etc/eyaml/config.yaml').
90+
with_ensure('file').
91+
with_owner('root').
92+
with_group('root').
93+
with_mode('0644').
94+
with_content(%r{pkcs7_private_key: /dev/null/keys/private_key.pkcs7.pem}).
95+
with_content(%r{pkcs7_public_key: /dev/null/keys/public_key.pkcs7.pem})
96+
end
8797
end
8898

8999
describe 'other_backends' do

0 commit comments

Comments
 (0)