我有两个针对远程主机启动的剧本(10.233.84.58).当启动独立(ansible-playbook -i inventory.txt playbook.yml)时,它们工作正常.
第一个剧本包括第二个剧本,它是相同的,除了显然include:
---
- hosts: all
tasks:
- debug: msg="hello form playbook1"
# up to now the content is identical between playbook1.yaml and playbook2.yaml
# without the next line the playbook runs fine
- include: playbook2.yml
Run Code Online (Sandbox Code Playgroud)
当我跑playbook1.yml:
# ansible-playbook -i inventory.txt playbook1.yml (master?)
PLAY [all] *********************************************************************
TASK [setup] *******************************************************************
ok: [10.233.84.58]
TASK [debug] *******************************************************************
ok: [10.233.84.58] => {
"msg": "hello form playbook1"
}
TASK [include] *****************************************************************
fatal: [10.233.84.58]: FAILED! …Run Code Online (Sandbox Code Playgroud)