Skip to content

Commit

Permalink
Merge pull request ghoneycutt#51 from ghoneycutt/support_puppet34_and…
Browse files Browse the repository at this point in the history
…_ruby2

Support Puppet v3.4 and Ruby v2.0.0
  • Loading branch information
ghoneycutt committed Feb 6, 2014
2 parents 497a5bb + cd5e300 commit 03d8afc
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 48 deletions.
18 changes: 9 additions & 9 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
fixtures:
repositories:
"stdlib":
repo: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
ref: "3.2.0"
"common":
repo: "git://github.com/ghoneycutt/puppet-module-common.git"
ref: "v1.0.2"
"firewall":
repo: "git://github.com/puppetlabs/puppetlabs-firewall.git"
stdlib:
repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '3.2.0'
common:
repo: 'git://github.com/ghoneycutt/puppet-module-common.git'
ref: 'v1.0.2'
firewall:
repo: 'git://github.com/puppetlabs/puppetlabs-firewall.git'
symlinks:
"ssh": "#{source_dir}"
ssh: "#{source_dir}"
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ rvm:
- 1.8.7
- 1.9.3
- 2.0.0
matrix:
fast_finish: true
allow_failures:
- rvm: 2.0.0
- 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 03d8afc

Please sign in to comment.