I am planning to execute a shell script on a remote server using Ansible playbook.
blank test.sh file:
touch test.sh
Playbook:
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