summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Barton <barton.tomas@gmail.com>2014-01-26 09:36:35 +0100
committerTomas Barton <barton.tomas@gmail.com>2014-01-26 18:26:34 +0100
commit78f1ff00d09d0ebf8f132e70444b9bcf030b6711 (patch)
treecc4ef1f3b2758b6097dbb66720a86d02b703476b
parentaee6885940cad29ff4ab7437e89c394bc1c19a46 (diff)
replaces shared-lsb by puppetlabs/stdlib
-rw-r--r--Modulefile2
-rw-r--r--Puppetfile2
-rw-r--r--Puppetfile.lock6
-rw-r--r--README.md2
-rw-r--r--manifests/debian.pp4
-rw-r--r--spec/classes/init_spec.rb24
-rw-r--r--spec/spec_helper.rb2
-rw-r--r--spec/spec_helper_system.rb1
8 files changed, 38 insertions, 5 deletions
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