From 4831c22352793e205533bcc196a94afd325b2348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Can=C3=A9vet?= Date: Wed, 5 Dec 2012 15:31:52 +0100 Subject: Lint class augeas --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 7919625..e82e21c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,5 +1,5 @@ class augeas { - case $operatingsystem { + case $::operatingsystem { /RedHat|CentOS|Fedora/: { include augeas::redhat } /Debian|Ubuntu|kFreeBSD/: { include augeas::debian } default: { include augeas::base } -- cgit v1.2.3 From 5e10cf78b2e0630354e55d20f3eced01e56c36af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Can=C3=A9vet?= Date: Wed, 5 Dec 2012 15:34:54 +0100 Subject: Lint augeas::debian --- manifests/debian.pp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/debian.pp b/manifests/debian.pp index 5b737d6..a56d8f0 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -2,10 +2,12 @@ class augeas::debian inherits augeas::base { package { ['augeas-lenses', 'libaugeas0', 'augeas-tools']: - ensure => "${augeas::base::version}", + ensure => $augeas::base::version, before => File['/usr/share/augeas/lenses'], } - package {'libaugeas-ruby1.8': ensure => "${augeas::base::rubylib_version}" } + package {'libaugeas-ruby1.8': + ensure => $augeas::base::rubylib_version, + } } -- cgit v1.2.3 From e5e802656e05c19f0ec5ec9830f83fd0f710edaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Can=C3=A9vet?= Date: Wed, 5 Dec 2012 15:36:02 +0100 Subject: Lint augeas::lens --- manifests/lens.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/lens.pp b/manifests/lens.pp index 95f7370..ee85318 100644 --- a/manifests/lens.pp +++ b/manifests/lens.pp @@ -3,7 +3,8 @@ == Definition: augeas::lens Deploy an Augeas lens (and its test file). -Check the lens (and run the unit tests) automatically and remove the files if the checks fail. +Check the lens (and run the unit tests) automatically and remove the files if +the checks fail. Parameters: - *ensure*: present/absent -- cgit v1.2.3 From ec6c45c149f7f4d4b9e0b6de00e5744777d1f1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Can=C3=A9vet?= Date: Wed, 5 Dec 2012 15:42:12 +0100 Subject: Lint augeas::redhat --- manifests/redhat.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/redhat.pp b/manifests/redhat.pp index e03b420..1e95728 100644 --- a/manifests/redhat.pp +++ b/manifests/redhat.pp @@ -2,9 +2,12 @@ class augeas::redhat inherits augeas::base { package { ['augeas', 'augeas-libs']: - ensure => "${augeas::base::version}", + ensure => $augeas::base::version, before => File['/usr/share/augeas/lenses'], } - package { 'ruby-augeas': ensure => "${augeas::base::rubylib_version}" } + + package { 'ruby-augeas': + ensure => $augeas::base::rubylib_version, + } } -- cgit v1.2.3 From 8c756b45ea391dd53a6f2d83a460e92d27caab96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= Date: Thu, 27 Dec 2012 09:11:53 +0100 Subject: Ensure Augeas ruby lib is for 1.9.1 on wheezy --- manifests/debian.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/debian.pp b/manifests/debian.pp index a56d8f0..bc2e3eb 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -6,7 +6,12 @@ class augeas::debian inherits augeas::base { before => File['/usr/share/augeas/lenses'], } - package {'libaugeas-ruby1.8': + $augeas_ruby = $::lsbdistcodename ? { + 'wheezy' => 'libaugeas-ruby1.9.1', + default => 'libaugeas-ruby1.8', + } + + package {$augeas_ruby: ensure => $augeas::base::rubylib_version, } -- cgit v1.2.3 From 383692c50f0cf8e7b2a25951c31b916effac899d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= Date: Tue, 8 Jan 2013 17:39:19 +0100 Subject: Add stock_since to augeas::lens --- manifests/lens.pp | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'manifests') diff --git a/manifests/lens.pp b/manifests/lens.pp index ee85318..55dc9ae 100644 --- a/manifests/lens.pp +++ b/manifests/lens.pp @@ -10,12 +10,15 @@ Parameters: - *ensure*: present/absent - *lens_source*: the source for the lens - *test_source*: optionally, the source for the test file. +- *stock_since*: optionally, indicate in which version of Augeas + the lens became stock, so it will not be deployed above that version. Example usage: augeas::lens { 'networkmanager': lens_source => 'puppet:///modules/networkmanager/lenses/networkmanager.aug', test_source => 'puppet:///modules/networkmanager/lenses/test_networkmanager.aug', + stock_since => '1.0.0', } */ @@ -23,36 +26,39 @@ Example usage: define augeas::lens ( $lens_source, $ensure=present, - $test_source=false + $test_source=false, + $stock_since=false, ) { - include augeas::base + if (!$stock_since or !versioncmp($::augeasversion, $stock_since)) { + include augeas::base - $lens_dest = "${augeas::base::lens_dir}/${name}.aug" - $test_dest = "${augeas::base::lens_dir}/tests/test_${name}.aug" + $lens_dest = "${augeas::base::lens_dir}/${name}.aug" + $test_dest = "${augeas::base::lens_dir}/tests/test_${name}.aug" - file { $lens_dest: - ensure => $ensure, - source => $lens_source, - } - - exec { "Typecheck lens ${name}": - command => "augparse -I ${augeas::base::lens_dir} ${lens_dest} || (rm -f ${lens_dest} && exit 1)", - refreshonly => true, - subscribe => File[$lens_dest], - } - - if $test_source { - file { $test_dest: + file { $lens_dest: ensure => $ensure, - source => $test_source, - notify => Exec["Test lens ${name}"], + source => $lens_source, } - exec { "Test lens ${name}": - command => "augparse -I ${augeas::base::lens_dir} ${test_dest} || (rm -f ${lens_dest} && rm -f ${test_dest} && exit 1)", + exec { "Typecheck lens ${name}": + command => "augparse -I ${augeas::base::lens_dir} ${lens_dest} || (rm -f ${lens_dest} && exit 1)", refreshonly => true, - subscribe => File[$lens_dest, $test_dest], + subscribe => File[$lens_dest], + } + + if $test_source { + file { $test_dest: + ensure => $ensure, + source => $test_source, + notify => Exec["Test lens ${name}"], + } + + exec { "Test lens ${name}": + command => "augparse -I ${augeas::base::lens_dir} ${test_dest} || (rm -f ${lens_dest} && rm -f ${test_dest} && exit 1)", + refreshonly => true, + subscribe => File[$lens_dest, $test_dest], + } } } } -- cgit v1.2.3