Skip to content

Commit

Permalink
Support Puppet v3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoneycutt committed Feb 6, 2014
1 parent a2484ab commit cd5e300
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 38 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ rvm:
- 1.8.7
- 1.9.3
- 2.0.0
matrix:
fast_finish: true
allow_failures:
- env: PUPPET_VERSION=3.4.2
language: ruby
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'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The module uses exported resources to manage ssh keys and removes ssh keys that

# 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
* EL 5
Expand Down
11 changes: 5 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@
$sshd_config_subsystem_sftp_real = $sshd_config_subsystem_sftp
}

package { 'ssh_packages':
package { $packages_real:
ensure => installed,
name => $packages_real,
}

file { 'ssh_config' :
Expand All @@ -185,7 +184,7 @@
group => $ssh_config_group,
mode => $ssh_config_mode,
content => template('ssh/ssh_config.erb'),
require => Package['ssh_packages'],
require => Package[$packages_real],
}

file { 'sshd_config' :
Expand All @@ -195,7 +194,7 @@
owner => $sshd_config_owner,
group => $sshd_config_group,
content => template('ssh/sshd_config.erb'),
require => Package['ssh_packages'],
require => Package[$packages_real],
}

if $sshd_config_banner != 'none' and $sshd_banner_content != undef {
Expand All @@ -206,7 +205,7 @@
group => $sshd_banner_group,
mode => $sshd_banner_mode,
content => $sshd_banner_content,
require => Package['ssh_packages'],
require => Package[$packages_real],
}
}

Expand Down Expand Up @@ -265,7 +264,7 @@
ensure => $ssh_key_ensure,
type => $ssh_key_type,
key => $key,
require => Package['ssh_packages'],
require => Package[$packages_real],
}

# import all nodes' ssh keys
Expand Down
54 changes: 27 additions & 27 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@

it { should_not contain_class('common')}

it {
should contain_package('ssh_packages').with({
'ensure' => 'installed',
'name' => ['openssh-server','openssh-clients'],
})
}
['openssh-server','openssh-clients'].each do |pkg|
it {
should contain_package(pkg).with({
'ensure' => 'installed',
})
}
end

it {
should contain_file('ssh_config').with({
Expand All @@ -30,7 +31,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
'require' => 'Package[ssh_packages]',
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
})
}

Expand All @@ -49,7 +50,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0600',
'require' => 'Package[ssh_packages]',
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
})
}

Expand Down Expand Up @@ -101,12 +102,13 @@

it { should_not contain_class('common')}

it {
should contain_package('ssh_packages').with({
'ensure' => 'installed',
'name' => ['openssh-server','openssh-client'],
})
}
['openssh-server','openssh-client'].each do |pkg|
it {
should contain_package(pkg).with({
'ensure' => 'installed',
})
}
end

it {
should contain_file('ssh_config').with({
Expand All @@ -115,7 +117,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
'require' => 'Package[ssh_packages]',
'require' => ['Package[openssh-server]', 'Package[openssh-client]'],
})
}

Expand All @@ -134,7 +136,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0600',
'require' => 'Package[ssh_packages]',
'require' => ['Package[openssh-server]', 'Package[openssh-client]'],
})
}

Expand Down Expand Up @@ -189,9 +191,8 @@
it { should_not contain_class('common')}

it {
should contain_package('ssh_packages').with({
should contain_package('openssh').with({
'ensure' => 'installed',
'name' => 'openssh',
})
}

Expand All @@ -202,7 +203,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
'require' => 'Package[ssh_packages]',
'require' => 'Package[openssh]',
})
}

Expand All @@ -221,7 +222,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0600',
'require' => 'Package[ssh_packages]',
'require' => 'Package[openssh]',
})
}

Expand Down Expand Up @@ -276,9 +277,8 @@
it { should_not contain_class('common')}

it {
should contain_package('ssh_packages').with({
should contain_package('openssh').with({
'ensure' => 'installed',
'name' => 'openssh',
})
}

Expand All @@ -289,7 +289,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
'require' => 'Package[ssh_packages]',
'require' => 'Package[openssh]',
})
}

Expand All @@ -308,7 +308,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0600',
'require' => 'Package[ssh_packages]',
'require' => 'Package[openssh]',
})
}

Expand Down Expand Up @@ -393,7 +393,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
'require' => 'Package[ssh_packages]',
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
})
}

Expand Down Expand Up @@ -444,7 +444,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0600',
'require' => 'Package[ssh_packages]',
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
})
}

Expand Down Expand Up @@ -472,7 +472,7 @@
'group' => 'root',
'mode' => '0644',
'content' => 'textinbanner',
'require' => 'Package[ssh_packages]',
'require' => ['Package[openssh-server]', 'Package[openssh-clients]'],
})
}
end
Expand Down

0 comments on commit cd5e300

Please sign in to comment.