Skip to content

Commit

Permalink
Merge pull request #427 from cedef/allow-authk-string
Browse files Browse the repository at this point in the history
Fix variable type to allow authkey to be a string
  • Loading branch information
alexjfisher authored Nov 21, 2017
2 parents a8bfefb + f81c0a6 commit a8f9672
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
class corosync(
Boolean $enable_secauth = $corosync::params::enable_secauth,
Enum['file', 'string'] $authkey_source = $corosync::params::authkey_source,
Stdlib::Absolutepath $authkey = $corosync::params::authkey,
Variant[Stdlib::Absolutepath,String[1]] $authkey = $corosync::params::authkey,
Optional[Integer] $threads = undef,
Integer[0,65535] $port = $corosync::params::port,
Corosync::IpStringIp $bind_address = $corosync::params::bind_address,
Expand Down
23 changes: 23 additions & 0 deletions spec/classes/corosync_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,29 @@
end
end

context 'when authkey is a string' do
before do
params.merge!(
authkey_source: 'string',
authkey: 'mysecretkey'
)
end
it 'deploys authkey file' do
is_expected.to contain_file('/etc/corosync/authkey').with_content('mysecretkey')
end
end

context 'when authkey is a file' do
before do
params.merge!(
authkey: '/etc/pki/tls/private/corosync.key'
)
end
it 'deploys authkey file' do
is_expected.to contain_file('/etc/corosync/authkey').with_source('/etc/pki/tls/private/corosync.key')
end
end

context 'when multicast_address, unicast_addresses and cluster_name are not set' do
before do
params.merge!(
Expand Down

0 comments on commit a8f9672

Please sign in to comment.