我有一本完美的劇本。當我運行劇本時,我指定要使用哪個環境文件。在劇本中包含劇本並定義環境文件
ansible-playbook playbooks/release-deploy.yaml -i env/LAB3
在劇本中,我打電話給另一個劇本,我想要使用相同的環境文件。
我現在的配置是:
- include: tasks/replace_configs.yaml
所以,當我跑了劇本,我得到的錯誤:
TASK [include] *****************************************************************
fatal: [10.169.99.70]: FAILED! => {"failed": true, "reason": "no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to have been in '/home/ansible/playbooks/tasks/replace_configs.yaml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- hosts: cac
^here
The error appears to have been in '/home/ansible/playbooks/tasks/replace_configs.yaml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- hosts: cac
^here
"}
tasks/replace_configs.yaml
還需要使用env/LAB3
看起來它不」不知道什麼cac
是。我需要做另一個配置嗎?
分享您的包含文件以及env文件 – Shasha99