运行以下剧本语法似乎是正确的,但得到以下错误!-
ERROR! 'blockinfile' is not a valid attribute for a Play
The error appears to have been in '/root/playbook1.yml': line 2, column 3, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: insertupdate
^ here
我的剧本文件代码是:
---
- name: insertupdate
blockinfile:
dest: /etc/network/interfaces
block: |
iface eth2 inet static
address 192.168.0.1
netmask 255.255.255.0
顺便说一句,我使用的是 Ansible 版本 2.x