Eu herdei um playbook como um arquivo thing.yaml
com o seguinte conteúdo:
---
- include: one.yaml
- include: two.yaml
Eu costumo iniciar os arquivos yaml com ansible-playbook
como posso fazer com one.yaml
e two.yaml
, mas thing.yaml
é rejeitado com:
ERROR! 'include' is not a valid attribute for a Play
The error appears to be in '.../thing.yaml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- include: one.yaml
^ here
Qual linha de comando vai comer arquivos com includes assim?
Você está procurando
include_tasks
, nãoinclude
. Consulte https://docs.ansible.com/ansible/2.8/modules/include_tasks_module.htmlO
include
módulo foi preterido comansible
a versão 2.16, porqueFonte: Documentação Ansible
As alternativas são
include_tasks
,import_tasks
eimport_playbook
. (Meu palpite pessoalinclude_role
também é, mas não está listado.)