我正在尝试使用with_items
命令运行多个角色,但是出现错误:
“错误!‘项目’未定义”
role.yml
:
---
- hosts: '{{ host }}'
become: yes
roles:
- role: "{{item}}"
with_items: "{{ roles }}"
这是我的命令:
ansible-playbook -i ./inventory/Dev ./playbooks/role.yml --extra-vars='{"host": "db", "roles": ["mysql", "apache"]}'