我想在ansible上删除多个数据库(MySQL):
- name: Drop databases on Ansible
local_action: mysql_db name= {{ item.name }} state=absent
with_items:
- { name: dba }
- { name: dbb }
- { name: dbc }
...
我有这个错误:
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/etc/ansible/roles/drop-db/tasks/main.yml': line 7, column 15, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
local_action: mysql_db name= {{ item.name }} state=absent
with_items:
^ here
答案 0 :(得分:2)
修复你的缩进!
使用Ansible的表示法时,请勿在{{1}}和值之间添加空格。
=