Fix idempotence of tools task

Change-Id: I0504dfc19c84a0fe10a5d93575f9ddcfbe60b167
Closes-bug: 1524713
This commit is contained in:
Bartłomiej Piotrowski 2015-12-12 21:25:31 +01:00
parent 8f2f65f2ed
commit 8934bd23cb
3 changed files with 5 additions and 30 deletions

View File

@ -78,6 +78,7 @@ class osnailyfacter::ssh(
command => 'ssh-keygen -A',
path => ['/bin', '/usr/bin'],
require => Class['ssh::server'],
creates => '/etc/ssh/ssh_host_ed25519_key',
}
}
}

View File

@ -7,33 +7,16 @@ if $::virtual != 'physical' {
class { 'osnailyfacter::acpid': }
}
case $::osfamily {
'RedHat': {
if $::operatingsystemmajrelease >= 7 {
$man_package = 'man-db'
} else {
$man_package = 'man'
}
}
'Debian': {
$man_package = 'man'
}
default: { fail("Unsupported osfamily: ${::osfamily}") }
}
$tools = [
'screen',
'tmux',
'htop',
'tcpdump',
'strace',
'fuel-misc'
'fuel-misc',
'man-db',
]
package { $man_package:
ensure => 'present',
}
package { $tools :
ensure => 'present',
}

View File

@ -8,7 +8,8 @@ tools = [
'htop',
'tcpdump',
'strace',
'fuel-misc'
'fuel-misc',
'man-db',
]
puppet = Noop.hiera('puppet')
@ -46,16 +47,6 @@ describe manifest do
end
end
it 'should install man package' do
if facts[:osfamily] == 'Redhat'
if facts[:operatingsystemmajrelease] >= 7
should contain_package('man-db').with({'ensure' => 'present'})
else
should contain_package('man').with({'ensure' => 'present'})
end
end
end
it do
should contain_package('cloud-init').with({
'ensure' => 'absent'})