From 9eae5e5a38469526142fa1e26756f1cd388be66d Mon Sep 17 00:00:00 2001 From: boom2 Date: Wed, 20 Dec 2023 09:53:51 -0500 Subject: - add fetch samples -- add the fetched files - add tags to verify samples --- ansible-practice/system/15-fetch-file.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ansible-practice/system/15-fetch-file.yml (limited to 'ansible-practice/system/15-fetch-file.yml') diff --git a/ansible-practice/system/15-fetch-file.yml b/ansible-practice/system/15-fetch-file.yml new file mode 100644 index 0000000..ed8690d --- /dev/null +++ b/ansible-practice/system/15-fetch-file.yml @@ -0,0 +1,23 @@ +# +# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/fetch_module.html +# +# - need to play with looping thru items +# +--- +- name: "15 - custom ansible - fetch file" + hosts: dev + become: yes # Run tasks with root/sudo privileges + + tasks: + - name: pull sshd config + ansible.builtin.fetch: + src: /etc/ssh/sshd_config + dest: ~/repos/ansible_repo/ansible-practice/system/ + tags: ['fetch_sshd_config'] + + - name: pull sshd config + ansible.builtin.fetch: + src: /etc/rc.d/rc.firewall + dest: ~/repos/ansible_repo/ansible-practice/system/ + tags: ['fetch_firewall_config'] + -- cgit v1.2.3-54-g00ecf