Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Ruch committed Dec 18, 2024
1 parent f99af5b commit 705ef8c
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions network/backup.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
- name: Create network reports
- name: Create network reports server
hosts: "{{ report_server }}"
become: true
vars:
report_server: reports
web_path: /var/www/html/reports/
backup_path: /var/www/html/backups/
backup_path: /var/www/html/backups

tasks:
- name: Build report server
Expand All @@ -28,9 +27,7 @@
gather_facts: false
vars:
report_server: reports
# web_path: /tmp/backup
backup_path: /var/www/html/backups/
troubleshooting: true
backup_path: "{{ backup_path }}"

tasks:

Expand All @@ -51,28 +48,12 @@
line: "Building configuration..."
state: absent

- name: List files in /tmp
when: troubleshooting
delegate_to: localhost
run_once: true
ansible.builtin.command:
cmd: ls /tmp/network_local_backup
register: backup_files

- name: Print files in /tmp
when: troubleshooting
delegate_to: localhost

run_once: true
ansible.builtin.debug:
msg: "{{ item }}"
loop: "{{ backup_files.stdout_lines }}"

- name: Copy backup file
delegate_to: "{{ report_server }}"
ansible.builtin.copy:
src: "/tmp/network_local_backup/{{ inventory_hostname }}.txt"
dest: "{{ backup_path }}/{{ inventory_hostname }}.cfg"
backup: true
owner: ec2-user
group: ec2-user
mode: '0644'
Expand Down

0 comments on commit 705ef8c

Please sign in to comment.