当前位置: 首页 > linux, 系统 > 正文

the offending line appears to be errors on ansible roles

ansible errors:the offending line appears to be error。使用 roles 方式可以自动加载指定目录树中的vars, files, tasks, 和 handlers。在实际中执行playbook有上述错误出现,开始以为是缩进的问题,后来发现指定目录中的main.yml中会把目录的名字自动认为对应的key:value中的key,yml中应该去掉该key值!

按照ansible文档说明,使用roles时,需要创建对应的目录和默认的yml文件:main.yml:

执行ansible-playbook命令后有The offending line appears to be的报错,具体如下:

具体修改:

修改后的执行结果:
$ ansible-playbook rolestest.yml

ansible-playbook-roles

ansible-playbook-roles

本文固定链接: https://www.sudops.com/offending-line-appears.html | 运维·速度

该日志由 Fisher 于2016年12月01日发表在 linux, 系统 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: the offending line appears to be errors on ansible roles | 运维·速度
关键字:

the offending line appears to be errors on ansible roles:等您坐沙发呢!

发表评论


Time limit is exhausted. Please reload the CAPTCHA.

快捷键:Ctrl+Enter