使用augeas修改默认的ss指令

时间:2015-07-13 14:57:36

标签: apache directive augeas

我正在尝试使用puppet清单中的augeas修改目录指令apache文件:

Apache文件提取:

   <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>

现在我可以使用sudo augtool运行下面的工作正常并修改“索引”参数:

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

但如果我把它添加到显示没有运气!!!

清单:

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

我尝试过设置命令但没有运气

任何想法?

感谢

NADS

1 个答案:

答案 0 :(得分:0)

Ok修复我删除了上下文并执行了以下操作:

    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",
    ],
   }