/
citrix-backup-config.yml
33 lines (30 loc) · 1011 Bytes
/
citrix-backup-config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
- name: CITRIX NETSCALER
block:
- name: grab and download citrix config
vars:
ansible_user: <un>
ansible_password: <pwd>
ansible_network_os: vyos
cli_command:
command: show ns runningConfig
register: citrix_output
- name: Save the backup information.
copy:
content: '{{ citrix_output.stdout_lines | to_nice_json }}'
dest: "{{ network_backup_dir }}/{{ net_backup_filename }}"
delegate_to: localhost
- name: Add SUCCESS line to file
ansible.builtin.lineinfile:
path: /root/configuration-backup-manager/templates/successful_hosts.txt
line: "{{ inventory_hostname }}"
when: citrix_output is defined
delegate_to: localhost
throttle: 1
rescue:
- name: Add ERROR line to file
ansible.builtin.lineinfile:
path: /root/configuration-backup-manager/templates/failed_hosts.txt
line: "{{ inventory_hostname }}"
delegate_to: localhost
throttle: 1