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
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
The biggest problem looks like all of your scripts assume relative paths. As a result it looks like things cannot be located. I’d recommend either adding pathing detection, or using full paths to those files.
the script dispatcher.sh is in the directory where start.sh is launched.
I understand your meaning but it is hard to modify scripts that are downloaded from a package and I do not own.
because chdir is supposed to change directory before running a script, it should find all files from that directory when running the script.
No it won't, ksh will first check if it find dispatcher.sh built-in command if not, it will search all directories in the PATH. It will not check the directory command is started from unless it is in PATH.