0

I have a playbook file containing below simple commands. ansible version 2.8.1 is installed on remote host.

Playbook file:

---
- name: Deploy accounts on AWS staging
  gather_facts: False
  hosts: Project_stage
  roles:
    - { role: stageRole }

Task file for role stageRole:

---
- name: Deploying WAR on EB
  command: eb --version chdir=/opt/EB_accounts

Upon executing above playbook, i can see below exception with error message as "msg": "[Errno 2] No such file or directory",

Exception:

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
SSF
  • 915
  • 5
  • 23
  • 47
prkumk
  • 133
  • 1
  • 8
  • 1
    Can you please provide more information. The error is not clear. – SSF Jul 02 '19 at 09:06
  • as a error message we are getting "[Errno 2] No such file or directory". upon checking through verbose flag. i could see exception as 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 – prkumk Jul 02 '19 at 09:10
  • I am assuming 'no such file or directory' is referring to '/opt/EB_accounts'? Can you check if that file exists? What are the permission of the file? – SSF Jul 02 '19 at 09:25
  • "/opt/EB_accounts" directory is present and it has necessary permission. – prkumk Jul 02 '19 at 09:27
  • 1
    what about providing full path for eb ? `command: /opt/EB_accounts/eb --version` . I'm not sure that using chdir implies having '.' in your PATH env. – tassinp Jul 03 '19 at 18:56
  • What user is used to run this command? does he has the relevant permissions on the folder? – Gal Gibli Jul 08 '19 at 12:02
  • We are using SSH to connect and user being used has necessary permissions. – prkumk Jul 08 '19 at 13:20

0 Answers0