[augeas-devel] Append to the last parameter in multiple entries

Brandon Whalen bwhalen at gmail.com
Wed May 26 20:39:45 UTC 2010


With the latest release to EPEL I'm back trying to use puppet and augeas to
configure an httpd.conf file. I've found an issue that I can't figure out
and am hoping you guys can help with. I want to do two things:

1) Remove any entry directory option that says ExecCGI. That one isn't bad.
2) Add in a parameter to every directory entry that says -ExecCGI

I tried this:
set /files/etc/httpd/conf/httpd.conf/<Directory[*]/Options/param[last()+1]
-ExecCGI

And it fails every time. I won't know how many Directory entries or
parameters I have ahead of time so that is not an option. I'm also trying to
do this inside of puppet so I'm limited by what puppet provides me. Anyone
have any ideas?


As a reminder a Directory entry in httpd.conf looks like

<Directory />
    Options -Indexes -ExecCGI -FollowSymLinks -IncludesNOEXEC -MultiViews
    AllowOverride None
</Directory>

The Directory tree looks like
augtool> ls /files/etc/httpd/conf/httpd.conf/<Directory[1]/
param = /
Options/ = (none)
AllowOverride/ = (none)


And the Options Tree:
augtool> ls /files/etc/httpd/conf/httpd.conf/<Directory[1]/Options
param[1] = -Indexes
param[2] = -ExecCGI
param[3] = -FollowSymLinks
param[4] = -IncludesNOEXEC
param[5] = -MultiViews


Thanks,
Brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20100526/253ae5b0/attachment.htm>


More information about the augeas-devel mailing list