Merge remote-tracking branch 'origin/master' into support_solaris

Get this branch up to date
This commit is contained in:
Garrett Honeycutt 2014-02-25 10:23:08 +01:00
commit 5b8317daa5
6 changed files with 94 additions and 49 deletions

View File

@ -1,12 +1,12 @@
fixtures: fixtures:
repositories: repositories:
"stdlib": stdlib:
repo: "git://github.com/puppetlabs/puppetlabs-stdlib.git" repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: "3.2.0" ref: '3.2.0'
"common": common:
repo: "git://github.com/ghoneycutt/puppet-module-common.git" repo: 'git://github.com/ghoneycutt/puppet-module-common.git'
ref: "v1.0.2" ref: 'v1.0.2'
"firewall": firewall:
repo: "git://github.com/puppetlabs/puppetlabs-firewall.git" repo: 'git://github.com/puppetlabs/puppetlabs-firewall.git'
symlinks: symlinks:
"ssh": "#{source_dir}" ssh: "#{source_dir}"

View File

@ -8,11 +8,6 @@ rvm:
- 1.8.7 - 1.8.7
- 1.9.3 - 1.9.3
- 2.0.0 - 2.0.0
matrix:
fast_finish: true
allow_failures:
- rvm: 2.0.0
- env: PUPPET_VERSION=3.4.2
language: ruby language: ruby
before_script: "gem install --no-ri --no-rdoc bundler" before_script: "gem install --no-ri --no-rdoc bundler"
script: 'bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec' script: 'bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec'

View File

@ -1,5 +1,5 @@
name 'ghoneycutt-ssh' name 'ghoneycutt-ssh'
version '3.6.0' version '3.6.1'
source 'git://github.com/ghoneycutt/puppet-module-ssh.git' source 'git://github.com/ghoneycutt/puppet-module-ssh.git'
author 'ghoneycutt' author 'ghoneycutt'
license 'Apache License, Version 2.0' license 'Apache License, Version 2.0'

View File

@ -8,7 +8,7 @@ The module uses exported resources to manage ssh keys and removes ssh keys that
# Compatability # # Compatability #
This module has been tested to work on the following systems with Puppet v3. This module has been tested to work on the following systems with Puppet v3 and Ruby versions 1.8.7, 1.9.3 and 2.0.0.
* Debian 7 * Debian 7
* EL 5 * EL 5

View File

@ -346,9 +346,59 @@ class ssh (
} }
} }
package { 'ssh_packages': case $::osfamily {
'RedHat': {
$default_packages = ['openssh-server',
'openssh-clients']
$default_sshd_config_subsystem_sftp = '/usr/libexec/openssh/sftp-server'
$default_service_name = 'sshd'
}
'Suse': {
$default_packages = 'openssh'
$default_service_name = 'sshd'
case $::architecture {
'x86_64': {
$default_sshd_config_subsystem_sftp = '/usr/lib64/ssh/sftp-server'
}
'i386' : {
$default_sshd_config_subsystem_sftp = '/usr/lib/ssh/sftp-server'
}
default: {
fail("ssh supports architectures x86_64 and i386 for Suse. Detected architecture is <${::architecture}>.")
}
}
}
'Debian': {
$default_packages = [ 'openssh-server',
'openssh-client']
$default_sshd_config_subsystem_sftp = '/usr/lib/openssh/sftp-server'
$default_service_name = 'ssh'
}
default: {
fail("ssh supports osfamilies RedHat, Suse and Debian. Detected osfamily is <${::osfamily}>.")
}
}
if $packages == 'USE_DEFAULTS' {
$packages_real = $default_packages
} else {
$packages_real = $packages
}
if $service_name == 'USE_DEFAULTS' {
$service_name_real = $default_service_name
} else {
$service_name_real = $service_name
}
if $sshd_config_subsystem_sftp == 'USE_DEFAULTS' {
$sshd_config_subsystem_sftp_real = $default_sshd_config_subsystem_sftp
} else {
$sshd_config_subsystem_sftp_real = $sshd_config_subsystem_sftp
}
package { $packages_real:
ensure => installed, ensure => installed,
name => $packages_real,
source => $ssh_package_source_real, source => $ssh_package_source_real,
adminfile => $ssh_package_adminfile_real, adminfile => $ssh_package_adminfile_real,
} }
@ -360,7 +410,7 @@ class ssh (
group => $ssh_config_group, group => $ssh_config_group,
mode => $ssh_config_mode, mode => $ssh_config_mode,
content => template('ssh/ssh_config.erb'), content => template('ssh/ssh_config.erb'),
require => Package['ssh_packages'], require => Package[$packages_real],
} }
file { 'sshd_config' : file { 'sshd_config' :
@ -370,7 +420,7 @@ class ssh (
owner => $sshd_config_owner, owner => $sshd_config_owner,
group => $sshd_config_group, group => $sshd_config_group,
content => template('ssh/sshd_config.erb'), content => template('ssh/sshd_config.erb'),
require => Package['ssh_packages'], require => Package[$packages_real],
} }
if $sshd_config_banner != 'none' and $sshd_banner_content != undef { if $sshd_config_banner != 'none' and $sshd_banner_content != undef {
@ -381,7 +431,7 @@ class ssh (
group => $sshd_banner_group, group => $sshd_banner_group,
mode => $sshd_banner_mode, mode => $sshd_banner_mode,
content => $sshd_banner_content, content => $sshd_banner_content,
require => Package['ssh_packages'], require => Package[$packages_real],
} }
} }
@ -440,7 +490,7 @@ class ssh (
ensure => $ssh_key_ensure, ensure => $ssh_key_ensure,
type => $ssh_key_type, type => $ssh_key_type,
key => $key, key => $key,
require => Package['ssh_packages'], require => Package[$packages_real],
} }
# import all nodes' ssh keys # import all nodes' ssh keys

View File

@ -16,12 +16,13 @@ describe 'ssh' do
it { should_not contain_class('common')} it { should_not contain_class('common')}
it { ['openssh-server','openssh-clients'].each do |pkg|
should contain_package('ssh_packages').with({ it {
'ensure' => 'installed', should contain_package(pkg).with({
'name' => ['openssh-server','openssh-clients'], 'ensure' => 'installed',
}) })
} }
end
it { it {
should contain_file('ssh_config').with({ should contain_file('ssh_config').with({
@ -30,7 +31,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0644', 'mode' => '0644',
'require' => 'Package[ssh_packages]', 'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
}) })
} }
@ -50,7 +51,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0600', 'mode' => '0600',
'require' => 'Package[ssh_packages]', 'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
}) })
} }
@ -387,12 +388,13 @@ describe 'ssh' do
it { should_not contain_class('common')} it { should_not contain_class('common')}
it { ['openssh-server','openssh-client'].each do |pkg|
should contain_package('ssh_packages').with({ it {
'ensure' => 'installed', should contain_package(pkg).with({
'name' => ['openssh-server','openssh-client'], 'ensure' => 'installed',
}) })
} }
end
it { it {
should contain_file('ssh_config').with({ should contain_file('ssh_config').with({
@ -401,7 +403,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0644', 'mode' => '0644',
'require' => 'Package[ssh_packages]', 'require' => ['Package[openssh-server]', 'Package[openssh-client]'],
}) })
} }
@ -421,7 +423,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0600', 'mode' => '0600',
'require' => 'Package[ssh_packages]', 'require' => ['Package[openssh-server]', 'Package[openssh-client]'],
}) })
} }
@ -482,9 +484,8 @@ describe 'ssh' do
it { should_not contain_class('common')} it { should_not contain_class('common')}
it { it {
should contain_package('ssh_packages').with({ should contain_package('openssh').with({
'ensure' => 'installed', 'ensure' => 'installed',
'name' => 'openssh',
}) })
} }
@ -495,7 +496,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0644', 'mode' => '0644',
'require' => 'Package[ssh_packages]', 'require' => 'Package[openssh]',
}) })
} }
@ -515,7 +516,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0600', 'mode' => '0600',
'require' => 'Package[ssh_packages]', 'require' => 'Package[openssh]',
}) })
} }
@ -576,9 +577,8 @@ describe 'ssh' do
it { should_not contain_class('common')} it { should_not contain_class('common')}
it { it {
should contain_package('ssh_packages').with({ should contain_package('openssh').with({
'ensure' => 'installed', 'ensure' => 'installed',
'name' => 'openssh',
}) })
} }
@ -589,7 +589,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0644', 'mode' => '0644',
'require' => 'Package[ssh_packages]', 'require' => 'Package[openssh]',
}) })
} }
@ -609,7 +609,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0600', 'mode' => '0600',
'require' => 'Package[ssh_packages]', 'require' => 'Package[openssh]',
}) })
} }
@ -700,7 +700,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0644', 'mode' => '0644',
'require' => 'Package[ssh_packages]', 'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
}) })
} }
@ -752,7 +752,7 @@ describe 'ssh' do
'owner' => 'root', 'owner' => 'root',
'group' => 'root', 'group' => 'root',
'mode' => '0600', 'mode' => '0600',
'require' => 'Package[ssh_packages]', 'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
}) })
} }
@ -786,7 +786,7 @@ describe 'ssh' do
'group' => 'root', 'group' => 'root',
'mode' => '0644', 'mode' => '0644',
'content' => 'textinbanner', 'content' => 'textinbanner',
'require' => 'Package[ssh_packages]', 'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
}) })
} }
end end