Skip to content

Commit

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

tasks:
Expand All @@ -27,7 +26,8 @@
gather_facts: false
vars:
report_server: reports
backup_path: "{{ backup_path }}"
backup_path: /var/www/html/backups
backup_dir: "/tmp/network_backups"

tasks:

Expand All @@ -38,20 +38,20 @@
operation: backup
type: full
data_store:
local: "/tmp/network_local_backup"
local: "{{ backup_dir }}"

# This task removes the Current configuration... from the top of IOS routers show run
- name: Remove non config lines - regexp
delegate_to: localhost
ansible.builtin.lineinfile:
path: "/tmp/network_local_backup/{{ inventory_hostname }}.txt"
path: "{{ backup_dir }}/{{ inventory_hostname }}.txt"
line: "Building configuration..."
state: absent

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

0 comments on commit eb2534a

Please sign in to comment.