Playbook to copy local file to hosts

This commit is contained in:
2023-11-21 12:27:48 +05:30
parent 1ed260f1cf
commit 2b1db56db7

17
playbooks/copy-file.yml Normal file
View File

@@ -0,0 +1,17 @@
---
- hosts: all
vars_prompt:
- name: path
prompt: "Enter path to file"
private: no
- name: remote_path
prompt: "Enter path to copy file to"
private: no
tasks:
- name: Copy file to remote hosts
copy:
src: "{{ path }}"
dest: "{{ remote_path }}"
owner: akshun
group: akshun
mode: u=rw,g=rw,o=r