@RaviTezu's solution does not work, because the file / script you want to execute must be located on the computer where you are executing your game / role.
According to the documentation here
The local script on the path will be passed to the remote node, and then executed.
Thus, one way to do this is to upload the file locally and use the task as shown below:
- name: execute the script.sh script: /local/path/to/script.sh
Or you can do this:
- name: download setup_5.x file to tmp dir get_url: url: https://deb.nodesource.com/setup_5.x dest: /tmp/ mode: 0755 - name: execute setup_5.x script shell: setup_5.x args: chdir: /tmp/
I would go for the first method if you load your own script, the second method is more useful in your case, because the script can be updated on time, so you are sure that every time you execute it, it uses the last script.
sys0dm1n
source share