我有几个角色需要在使用 --option extra-vars
inansible-playbook
命令配置服务器时调用。有人能帮我实现吗?我可以使用include-role
option inmain.yml
答案1
我已经解决如下问题:
---
- name: Calling role as per our requirement.
hosts: localhost
become: yes
become_user: root
roles:
- "{{ role1 }}"
- "{{ role2 }}"