From 7743650cde95129b4ace3ca14082ae3e47d671b6 Mon Sep 17 00:00:00 2001 From: Michael Moll Date: Sun, 3 Feb 2013 00:30:54 +0100 Subject: style fixes silence puppet-lint --- manifests/debian.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'manifests/debian.pp') diff --git a/manifests/debian.pp b/manifests/debian.pp index 45eb901..ced5db7 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -8,14 +8,14 @@ class sshd::debian inherits sshd::linux { } $sshd_restartandstatus = $::lsbdistcodename ? { - etch => false, + etch => false, default => true } Service[sshd]{ - name => 'ssh', - pattern => 'sshd', - hasstatus => $sshd_restartandstatus, + name => 'ssh', + pattern => 'sshd', + hasstatus => $sshd_restartandstatus, hasrestart => $sshd_restartandstatus, } } -- cgit v1.2.3 From 78f1ff00d09d0ebf8f132e70444b9bcf030b6711 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 26 Jan 2014 09:36:35 +0100 Subject: replaces shared-lsb by puppetlabs/stdlib --- Modulefile | 2 +- Puppetfile | 2 +- Puppetfile.lock | 6 ++++++ README.md | 2 +- manifests/debian.pp | 4 +++- spec/classes/init_spec.rb | 24 ++++++++++++++++++++++++ spec/spec_helper.rb | 2 +- spec/spec_helper_system.rb | 1 + 8 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 spec/classes/init_spec.rb (limited to 'manifests/debian.pp') diff --git a/Modulefile b/Modulefile index 5954df4..5e4f92d 100644 --- a/Modulefile +++ b/Modulefile @@ -7,4 +7,4 @@ summary 'ssh daemon configuration' description 'Manages sshd_config' project_page 'https://github.com/duritong/puppet-sshd' -#dependency 'puppetlabs/stdlib', '>= 0.1.6' \ No newline at end of file +dependency 'puppetlabs/stdlib', '>= 2.0.0' \ No newline at end of file diff --git a/Puppetfile b/Puppetfile index 113b12f..166d3b4 100644 --- a/Puppetfile +++ b/Puppetfile @@ -1,3 +1,3 @@ forge 'http://forge.puppetlabs.com' -#mod 'puppetlabs/stdlib', '>=0.1.6' \ No newline at end of file +mod 'puppetlabs/stdlib', '>=2.0.0' \ No newline at end of file diff --git a/Puppetfile.lock b/Puppetfile.lock index 51949ef..f938185 100644 --- a/Puppetfile.lock +++ b/Puppetfile.lock @@ -1,2 +1,8 @@ +FORGE + remote: http://forge.puppetlabs.com + specs: + puppetlabs/stdlib (4.1.0) + DEPENDENCIES + puppetlabs/stdlib (>= 2.0.0) diff --git a/README.md b/README.md index bc85552..cafdf11 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This module requires puppet => 2.6, and the following modules are required pre-dependencies: - shared-common: `git://labs.riseup.net/shared-common` -- shared-lsb: `git://labs.riseup.net/shared-lsb` +- [puppetlabs/stdlib](https://github.com/puppetlabs/puppetlabs-stdlib) >= 2.x ## OpenSSH Server diff --git a/manifests/debian.pp b/manifests/debian.pp index ced5db7..baacbba 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -1,7 +1,9 @@ class sshd::debian inherits sshd::linux { # the templates for Debian need lsbdistcodename - require lsb + ensure_resource('package', 'lsb-release', {'ensure' => 'present' }) + #requires stdlib >= 3.2 + #ensure_packages(['lsb-release']) Package[openssh]{ name => 'openssh-server', diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb new file mode 100644 index 0000000..c1d9b6f --- /dev/null +++ b/spec/classes/init_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe 'sshd' do + + + shared_examples "a Linux OS" do + it { should compile.with_all_deps } + it { should contain_class('sshd') } + it { should contain_class('sshd::client') } + end + + context "Debian OS" do + let :facts do + { + :operatingsystem => 'Debian', + :osfamily => 'Debian', + :lsbdistcodename => 'wheezy', + } + end + it_behaves_like "a Linux OS" + it { should contain_package('lsb-release') } + end + +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2d83617..b4123fd 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,7 +3,7 @@ $LOAD_PATH.unshift File.join(dir, 'lib') require 'puppet' require 'rspec' require 'puppetlabs_spec_helper/module_spec_helper' -require 'rspec-hiera-puppet' +#require 'rspec-hiera-puppet' require 'rspec-puppet/coverage' require 'rspec/autorun' diff --git a/spec/spec_helper_system.rb b/spec/spec_helper_system.rb index 44e0337..2c6812f 100644 --- a/spec/spec_helper_system.rb +++ b/spec/spec_helper_system.rb @@ -20,5 +20,6 @@ RSpec.configure do |c| puppet_install # Install modules and dependencies puppet_module_install(:source => proj_root, :module_name => 'sshd') + shell('puppet module install puppetlabs-stdlib') end end -- cgit v1.2.3 From 9dc5a1db18ac634512a5509685eaf3b3a60cf6c7 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Mon, 27 Jan 2014 00:04:33 +0100 Subject: removed special no-restart status for etch --- manifests/debian.pp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'manifests/debian.pp') diff --git a/manifests/debian.pp b/manifests/debian.pp index baacbba..ff2d7b1 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -9,15 +9,10 @@ class sshd::debian inherits sshd::linux { name => 'openssh-server', } - $sshd_restartandstatus = $::lsbdistcodename ? { - etch => false, - default => true - } - Service[sshd]{ name => 'ssh', pattern => 'sshd', - hasstatus => $sshd_restartandstatus, - hasrestart => $sshd_restartandstatus, + hasstatus => true, + hasrestart => true, } } -- cgit v1.2.3 From bf16ec7bc701ea7cfda7d64319920e3b9cca4a16 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Mon, 27 Jan 2014 00:14:34 +0100 Subject: removed lsb-release package --- manifests/debian.pp | 5 ----- spec/classes/init_spec.rb | 2 -- 2 files changed, 7 deletions(-) (limited to 'manifests/debian.pp') diff --git a/manifests/debian.pp b/manifests/debian.pp index ff2d7b1..d827078 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -1,10 +1,5 @@ class sshd::debian inherits sshd::linux { - # the templates for Debian need lsbdistcodename - ensure_resource('package', 'lsb-release', {'ensure' => 'present' }) - #requires stdlib >= 3.2 - #ensure_packages(['lsb-release']) - Package[openssh]{ name => 'openssh-server', } diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 7628be0..e3003d1 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -41,7 +41,6 @@ describe 'sshd' do } end it_behaves_like "a Linux OS" - it { should contain_package('lsb-release') } it { should contain_package('openssh') } it { should contain_class('sshd::debian') } it { should contain_service('sshd').with( @@ -56,7 +55,6 @@ describe 'sshd' do } end it_behaves_like "a Linux OS" - it { should contain_package('lsb-release') } it { should contain_package('openssh') } it { should contain_service('sshd').with({ :hasrestart => true -- cgit v1.2.3