you can use script module
Example
- name: Transfer and execute a script.
hosts: all
tasks:
- name: Copy and Execute the script
script: /home/user/userScript.sh
More Related Contents:
- Ansible Command module says that ‘|’ is illegal character
- How to do multiline shell script in Ansible
- Useless use of cat?
- How to use SSH to run a local shell script on a remote machine?
- Using cURL to upload POST data with files
- Interactive shell using Docker Compose
- Insert line after match using sed
- What’s an easy way to read random line from a file?
- Returning value from called function in a shell script
- Alternative to `sed -i` on Solaris
- Is there an Eclipse plugin to run system shell in the Console? [closed]
- commands not found on zsh [closed]
- Rename multiple files by replacing a particular pattern in the filenames using a shell script [duplicate]
- How do you catch error codes in a shell pipe?
- Concise and portable “join” on the Unix command-line
- How to add timestamp to STDERR redirection
- How do I get the effect and usefulness of “set -e” inside a shell function?
- How can I redirect the output of the “time” command?
- is it possible to use variables in remote ssh command?
- CMake’s execute_process and arbitrary shell scripts
- Permission denied at hdfs
- How to source a script in a Makefile?
- How to run a command in the background and get no output?
- How to input automatically when running a shell over SSH?
- How to call a function in shell Scripting?
- Which terminal command to get just IP address and nothing else?
- How to add text at the end of each line in unix
- How to print 5 consecutive lines after a pattern in file using awk [duplicate]
- how do I use the grep –include option for multiple file types?
- Batch convert latin-1 files to utf-8 using iconv