Set show_diff to false for Nova SSH private key

The private key is currently being leaked into
the diff output.

Conflicts:
	spec/classes/nova_init_spec.rb

Change-Id: I94170f76257c77d1eabeeb3d373c05c50413c53d
(cherry picked from commit 75fbe61987)
(cherry picked from commit 90af39c480)
This commit is contained in:
Tobias Urdin 2024-04-08 11:42:58 +02:00 committed by Takashi Kajinami
parent e7a09d24df
commit 36951d35cd
2 changed files with 9 additions and 7 deletions

View File

@ -527,11 +527,12 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
}
file { $nova_private_key_file:
content => $nova_private_key[key],
mode => '0600',
owner => $::nova::params::user,
group => $::nova::params::group,
require => File['/var/lib/nova/.ssh'],
content => $nova_private_key[key],
mode => '0600',
owner => $::nova::params::user,
group => $::nova::params::group,
show_diff => false,
require => File['/var/lib/nova/.ssh'],
}
}
}

View File

@ -347,7 +347,8 @@ describe 'nova' do
it 'should install ssh private key' do
is_expected.to contain_file('/var/lib/nova/.ssh/id_rsa').with(
:content => 'keydata'
:content => 'keydata',
:show_diff => false,
)
end
end
@ -362,7 +363,7 @@ describe 'nova' do
it 'should raise an error' do
expect {
is_expected.to contain_file('/var/lib/nova/.ssh/id_rsa').with(
:content => 'keydata'
:content => 'keydata',
)
}.to raise_error Puppet::Error, /You must provide both a key type and key data./
end