summaryrefslogtreecommitdiff
path: root/ansible-practice/system/15-fetch-file.yml
diff options
context:
space:
mode:
authorboom2 <blizzack@blizzack.com>2023-12-20 09:53:51 -0500
committerboom2 <blizzack@blizzack.com>2023-12-20 09:53:51 -0500
commit9eae5e5a38469526142fa1e26756f1cd388be66d (patch)
tree6be0c4e4dc2d24715510a1616a3a28e4370a669b /ansible-practice/system/15-fetch-file.yml
parenta6ddee3b7d7ca882772677013c7e02bb7a27a526 (diff)
- add fetch samples
-- add the fetched files - add tags to verify samples
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']
+