summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-02-27 23:07:07 +0100
committermh <mh@immerda.ch>2013-02-27 23:07:07 +0100
commit477e7f1923f4b4587ff1c07032e4b5ad849a9d27 (patch)
tree39d45e0b9305bd680e71b82497d37652cc721217
parent3174a2d0f8e453067a64428bad8af92fe98c53f1 (diff)
make version a class param
-rw-r--r--README4
-rw-r--r--manifests/base.pp10
-rw-r--r--manifests/debian.pp4
-rw-r--r--manifests/init.pp5
-rw-r--r--manifests/redhat.pp4
5 files changed, 10 insertions, 17 deletions
diff --git a/README b/README
index 8de2801..5001b08 100644
--- a/README
+++ b/README
@@ -8,9 +8,9 @@
This module does 3 things:
- o lets you force the augeas version by defining $augeas_version, otherwise puppet will
+ o lets you force the augeas version by defining $version, otherwise puppet will
only ensure the packages are present.
- o lets you force the ruby library version by defining $augeas_ruby_version, otherwise puppet will
+ o lets you force the ruby library version by defining $rubylib_version, otherwise puppet will
only ensure the libagueas-ruby version will be installed according to internal critera
o lets you deploy an augeas lens and any associated test files, running unit tests and not installing if they fail:
diff --git a/manifests/base.pp b/manifests/base.pp
index 37ad0e2..eb1a245 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,16 +1,6 @@
class augeas::base {
$lens_dir = '/usr/share/augeas/lenses'
- $version = $augeas_version ? {
- '' => 'present',
- default => $augeas_version
- }
-
- $rubylib_version = $augeas_ruby_version ? {
- '' => 'present',
- default => $augeas_ruby_version
- }
-
# ensure no file not managed by puppet ends up in there.
file { $lens_dir:
ensure => directory,
diff --git a/manifests/debian.pp b/manifests/debian.pp
index bc2e3eb..4f5783d 100644
--- a/manifests/debian.pp
+++ b/manifests/debian.pp
@@ -2,7 +2,7 @@ class augeas::debian inherits augeas::base {
package {
['augeas-lenses', 'libaugeas0', 'augeas-tools']:
- ensure => $augeas::base::version,
+ ensure => $augeas::version,
before => File['/usr/share/augeas/lenses'],
}
@@ -12,7 +12,7 @@ class augeas::debian inherits augeas::base {
}
package {$augeas_ruby:
- ensure => $augeas::base::rubylib_version,
+ ensure => $augeas::rubylib_version,
}
}
diff --git a/manifests/init.pp b/manifests/init.pp
index e82e21c..73b4fb7 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,4 +1,7 @@
-class augeas {
+class augeas(
+ $version = 'installed',
+ $rubylib_version = 'installed',
+) {
case $::operatingsystem {
/RedHat|CentOS|Fedora/: { include augeas::redhat }
/Debian|Ubuntu|kFreeBSD/: { include augeas::debian }
diff --git a/manifests/redhat.pp b/manifests/redhat.pp
index 1e95728..c165566 100644
--- a/manifests/redhat.pp
+++ b/manifests/redhat.pp
@@ -2,12 +2,12 @@ class augeas::redhat inherits augeas::base {
package {
['augeas', 'augeas-libs']:
- ensure => $augeas::base::version,
+ ensure => $augeas::version,
before => File['/usr/share/augeas/lenses'],
}
package { 'ruby-augeas':
- ensure => $augeas::base::rubylib_version,
+ ensure => $augeas::rubylib_version,
}
}