Merge pull request #215 from Arakmar/require_ssh_config
Make sure the ssh config dir is present before trying to define the known host file.
This commit is contained in:
commit
7582138819
@ -927,11 +927,12 @@ class ssh (
|
|||||||
}
|
}
|
||||||
|
|
||||||
file { 'ssh_known_hosts':
|
file { 'ssh_known_hosts':
|
||||||
ensure => file,
|
ensure => file,
|
||||||
path => $ssh_config_global_known_hosts_file,
|
path => $ssh_config_global_known_hosts_file,
|
||||||
owner => $ssh_config_global_known_hosts_owner,
|
owner => $ssh_config_global_known_hosts_owner,
|
||||||
group => $ssh_config_global_known_hosts_group,
|
group => $ssh_config_global_known_hosts_group,
|
||||||
mode => $ssh_config_global_known_hosts_mode,
|
mode => $ssh_config_global_known_hosts_mode,
|
||||||
|
require => Package[$packages_real],
|
||||||
}
|
}
|
||||||
|
|
||||||
# import all nodes' ssh keys
|
# import all nodes' ssh keys
|
||||||
|
@ -235,6 +235,12 @@ describe 'ssh' do
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
facts[:ssh_packages].each do |pkg|
|
||||||
|
it {
|
||||||
|
should contain_file('ssh_known_hosts').that_requires("Package[#{pkg}]")
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_file('ssh_config').with({
|
should contain_file('ssh_config').with({
|
||||||
'ensure' => 'file',
|
'ensure' => 'file',
|
||||||
@ -1990,6 +1996,7 @@ describe 'ssh' do
|
|||||||
'owner' => 'root',
|
'owner' => 'root',
|
||||||
'group' => 'root',
|
'group' => 'root',
|
||||||
'mode' => '0644',
|
'mode' => '0644',
|
||||||
|
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2086,6 +2093,7 @@ describe 'ssh' do
|
|||||||
'owner' => 'gh',
|
'owner' => 'gh',
|
||||||
'group' => 'root',
|
'group' => 'root',
|
||||||
'mode' => '0644',
|
'mode' => '0644',
|
||||||
|
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -2112,6 +2120,7 @@ describe 'ssh' do
|
|||||||
'owner' => 'root',
|
'owner' => 'root',
|
||||||
'group' => 'gh',
|
'group' => 'gh',
|
||||||
'mode' => '0644',
|
'mode' => '0644',
|
||||||
|
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -2138,6 +2147,7 @@ describe 'ssh' do
|
|||||||
'owner' => 'root',
|
'owner' => 'root',
|
||||||
'group' => 'root',
|
'group' => 'root',
|
||||||
'mode' => '0666',
|
'mode' => '0666',
|
||||||
|
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -2201,6 +2211,7 @@ describe 'ssh' do
|
|||||||
'owner' => 'root',
|
'owner' => 'root',
|
||||||
'group' => 'root',
|
'group' => 'root',
|
||||||
'mode' => '0644',
|
'mode' => '0644',
|
||||||
|
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user