我有一个剧本文件,其中包含以下简单命令。 ansible版本2.8.1已安装在远程主机上。
剧本文件:
---
- name: Deploy accounts on AWS staging
gather_facts: False
hosts: Project_stage
roles:
- { role: stageRole }
角色stageRole的任务文件:
---
- name: Deploying WAR on EB
command: eb --version chdir=/opt/EB_accounts
在执行上述剧本后,我可以看到以下异常,错误消息为“ msg”:“ [Errno 2]没有这样的文件或目录”,
例外:
host_web02 (0, '', '')
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
File "/**tmp/ansible_command_payload_ynqG_D/ansible_command_payload.zip/ansible/module_utils/basic.py**", line 2561, in run_command
cmd = subprocess.Popen(args, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception