Hello,

Here is my issue.
I have a script start.sh with the following lines:
#!/bin/ksh
dispatcher.sh --command=start --directory=..
returnCode=$?
exit $returnCode

the both scripts are in the same directory, with the 755 rights.

I run the task this way:
- name: Start
  shell: /bin/ksh start.sh
  args:
    chdir: "/{{ rep_user }}/{{ openhrname }}/bin"
  register: start_op

and I receive the following error:
fatal: [integ]: FAILED! => {"changed": true, "cmd": "/bin/ksh start.sh", 
"delta": "0:00:00.007132", "end": "2016-05-24 15:13:36.666862", "failed": 
true, "rc": 127, "start": "2016-05-24 15:13:36.659730", "stderr": 
"start_openhr.sh[2]: dispatcher.sh: not found [No such file or directory]", 
"stdout": "", "stdout_lines": [], "warnings": []}

I have tried to run dos2unix on these files before, without success.
I tried also many different ways to write the shell command, without any 
success:
shell: /bin/ksh ./start.sh
shell: chdir=/{{ rep_user }}/{{ openhrname }}/bin /bin/ksh ./start.sh

shell: /bin/ksh /{{ rep_user }}/{{ openhrname }}/bin/start.sh
  args:
    chdir: "/{{ rep_user }}/{{ openhrname }}/bin"

etc ... 

when I run it manually from the directory where the files are installed, I 
have no issue.
If I try to run the start.sh shell from another directory manually, the 
error occurs, which is normal.
Could it be an issue with chdir command ? I run Ansible version 2.1.0

Thanks a lot,
regards

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/027ee694-8ff2-4c87-9544-f0c51a13f77f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to