首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用ansible-playbook更新xml元素值

无法使用ansible-playbook更新xml元素值
EN

Stack Overflow用户
提问于 2019-03-20 19:29:27
回答 1查看 71关注 0票数 0

我正在使用下面的剧本来更新xml文件中的特定元素值及其抛出的错误。我已经安装了python-lxml模块以及ansible版本2.7.8

代码语言:javascript
复制
---
 - name: Set element
   xml:
     path: /home/emsuser/appD_agent_master/machineagent/machine_agent/conf/controller-info.xml
     xpath: /controller-info/application-name
     value: "Vicom Enterprise blackout Manager"
...

回应:

代码语言:javascript
复制
ERROR! 'xml' is not a valid attribute for a Play

The error appears to have been in '/home/emsuser/playbooks/editMechineAgentConf.yml': line 2, column 4, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
 - name: Set element
   ^ here

我不确定我在哪里做错了。请帮帮我。我是ansible的新手。

EN

回答 1

Stack Overflow用户

发布于 2019-03-22 05:35:23

你的代码不是剧本,它是一个任务文件。

在攻略中,您有一个tasks:部分列出了您的任务。

看一看Playbooks intro documentation

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

https://stackoverflow.com/questions/55259720

复制
相关文章

相似问题

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