Ok.. Here I go. This is my main.yml content.
- hosts: web-servers
tasks:
- name: Run the below script
command: sh temp/myscript.sh
I have a shell script named "myscript.sh" placed under a directory called 'temp'. My directory hierarchy is:
- ansible-copy-role (directory)
- main.yml
- temp (directory)
- myscript.sh ( I want to run this Shell script)
I don't want to copy the shell script to my host servers and run from thre. I want to run the shell script which will be available along with the main.yml file.
When I run this playbook, I get an error like: stderr: sh: temp/myscript.sh: No such file or directory
Please help on this.