summaryrefslogtreecommitdiff
path: root/ansible-practice/system/15-fetch-file.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible-practice/system/15-fetch-file.yml')
-rw-r--r--ansible-practice/system/15-fetch-file.yml23
1 files changed, 23 insertions, 0 deletions
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']
+