0

I am trying to modify directory directive apache file using augeas in a puppet manifest:

Apache file extract:

   <Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks 
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
   </Directory>

now i can run the below using sudo augtool which works fine and modifies the "Indexes" argument:

set /files/etc/apache2/sites-enabled/default/VirtualHost/Directory[4]/directive[1]/arg[1] "-Indexes"

but if i add it to manifest no luck !!!

manifest :

    augeas{ 'default':
    context =>  "/files/etc/apache2/sites-enabled/default",
    notify => Service["apache2"],
    changes =>  [
    "set /VirtualHost/Directory[4]/directive[1]/arg[1] -Indexes",
    ],
   }

i have tried to the set command but no luck

any ideas?

thanks

Nads

nad
  • 1

1 Answers1

0

Ok Fixed i removed context and did the following:

    augeas{ 'default':
    #context =>  "/files/etc/apache2/sites-enabled/default",
    notify => Service["apache2"],
           changes =>  [
    "set /files/etc/apache2/sites-enabled/default/VirtualHost/Directory[4]/directive[1]/arg[1] -Indexes",
    ],
   }
nad
  • 1
  • You could use context here. Just don't start with a `/` if you use context, that's the whole point… – raphink Jul 13 '15 at 15:44