Skip to content

Commit

Permalink
Merge pull request #1 from danbeaman/augeas-refactor
Browse files Browse the repository at this point in the history
Refactor Augeas resource
  • Loading branch information
garrettrowell authored Jun 29, 2016
2 parents b48e046 + 1d7b8d0 commit 04a4f4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ group :test do
gem "puppet-lint-version_comparison-check"
gem "puppet-lint-classes_and_types_beginning_with_digits-check"
gem "puppet-lint-unquoted_string-check"
gem "safe_yaml", '~> 1.0.4'
end

group :development do
Expand Down
11 changes: 7 additions & 4 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
augeas { 'cacti_perms':
incl => '/etc/httpd/conf.d/cacti.conf',
lens => 'Httpd.lns',
context => '/files/etc/httpd/conf.d/cacti.conf',
changes => [ 'set /files/etc/httpd/conf.d/cacti.conf/Directory[1]/IfModule[1]/directive/arg[1] all',
'set /files/etc/httpd/conf.d/cacti.conf/Directory[1]/IfModule[1]/directive/arg[2] granted',
'set /files/etc/httpd/conf.d/cacti.conf/Directory[1]/IfModule[2]/directive[3]/arg[2] all',
changes => [
'defnode req Directory[arg="/usr/share/cacti/"]/IfModule[arg="mod_authz_core.c"]/directive[.="Require"] "Require"',
'set $req/arg[1] "all"',
'set $req/arg[2] "granted"',

'defnode nomodauthzcore Directory[arg="/usr/share/cacti/"]/IfModule[arg="!mod_authz_core.c"] ""',
'set $nomodauthzcore/directive[.="Allow"]/arg[2] "all"',
],
}

Expand Down
3 changes: 1 addition & 2 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
it do
is_expected.to contain_augeas('cacti_perms').
with({"incl"=>"/etc/httpd/conf.d/cacti.conf",
"lens"=>"Httpd.lns",
"context"=>"/files/etc/httpd/conf.d/cacti.conf"})
"lens"=>"Httpd.lns"})
end
it do
is_expected.to contain_cron__job('cacti').
Expand Down

0 comments on commit 04a4f4c

Please sign in to comment.