Files
ansible/playbooks/run-remote-script.yml
2023-11-26 19:59:13 +05:30

21 lines
453 B
YAML

---
- hosts: all
become: true
vars_prompt:
- name: script
prompt: "Enter the script to be run"
private: no
- name: argument
prompt: "Enter the argument"
private: no
tasks:
- name: Fetch script
ansible.builtin.uri:
url: "{{ script }}"
return_content: yes
register: sc
- name: Run script
ansible.builtin.shell:
cmd: "{{ argument }}"
stdin: "{{ sc.content }}"