首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用augeas在hosts.allow中创建新条目

无法使用augeas在hosts.allow中创建新条目
EN

Stack Overflow用户
提问于 2015-01-15 16:15:07
回答 1查看 691关注 0票数 0

我尝试在hosts.allow中创建一个新条目

代码语言:javascript
复制
 augeas { "Add in hosts allow" : 
        context => '/files/etc/hosts.allow',
        changes => [
        'ins 01 after *[last()]',
        'set 01/process[1] ssh',
        'set 01/process[2] ssh2',
        'set 01/client ipaddr'
      ],
  }

但是它不工作,我得到这个错误

代码语言:javascript
复制
Notice: Compiled catalog for server.local in environment production in 0.96 seconds
Error: /Stage[main]/Nfs::Server/Augeas[Add in hosts allow]: Could not evaluate: Error sending    
command 'ins' with params ["01", "after", "/files/etc/hosts.allow/*[last()]"]/Error sending 
command 'ins' with params ["01", "after", "/files/etc/hosts.allow/*[last()]"]

我不知道如何使用ins命令,消息不会让我知道出了什么问题。

CentOS6.4

木偶版本: 3.3.1

augeasversion (来自facter):0.9.0

我找不到augtools的版本,也无法执行命令,因为它没有安装(我不知道puppet如何调用它)

EN

回答 1

Stack Overflow用户

发布于 2015-01-15 16:54:09

是否尝试在上下文中添加前导"/“?

(日志记录有点奇怪,根本没有显示"files“前缀,我想知道您的代码示例和日志记录是否匹配。)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27959119

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档