我的 ansible 角色有这个 main.yml
more tasks/main.yml
---
- include: ssl_pull.yml
when: ACTION == 'renewal'
- include: ssl_gen.yml
when: ACTION == 'generate'
- include: ssl_push.yml
when: ACTION == 'install'
- include: ssl_install.yml
when: ACTION == 'install'
我希望让用户能够通过多个操作,例如续订和安装,因此它包括
- include: ssl_pull.yml
- include: ssl_push.yml
- include: ssl_install.yml
我知道如何为 ACTION 变量传递单个值,如下所示
ansible-playbook -v -i /web/hosts.txt site.yml -e "ACTION=renewal"
如何,我可以传递一个或多个值并根据传递的值包含文件吗?
您能否建议我需要对我的命令 / yml 进行哪些更改?