53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
---
|
|
# Re-write of:
|
|
# https://github.com/network-automation/toolkit/blob/master/playbooks/network_report.yml
|
|
# https://github.com/network-automation/toolkit/blob/master/roles/build_report/tasks/main.yml
|
|
|
|
- name: Collect facts
|
|
hosts: "{{ _hosts | default(omit) }}"
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
- name: Gather all network resource and minimal legacy facts [Cisco IOS]
|
|
cisco.ios.ios_facts:
|
|
gather_subset: min
|
|
gather_network_resources: all
|
|
when: ansible_network_os == 'cisco.ios.ios'
|
|
|
|
- name: Gather all network resource and minimal legacy facts [Cisco NX-OS]
|
|
cisco.nxos.nxos_facts:
|
|
gather_subset: min
|
|
gather_network_resources: all
|
|
when: ansible_network_os == 'cisco.nxos.nxos'
|
|
|
|
- name: Gather all network resource and minimal legacy facts [Cisco IOS XR]
|
|
cisco.iosxr.iosxr_facts:
|
|
gather_subset: min
|
|
gather_network_resources: all
|
|
when: ansible_network_os == 'cisco.iosxr.iosxr'
|
|
|
|
# The dig lookup requires the python 'dnspython' library
|
|
# - name: Resolve IP address
|
|
# ansible.builtin.set_fact:
|
|
# ansible_host: "{{ lookup('community.general.dig', inventory_hostname)}}"
|
|
|
|
- name: Create network reports
|
|
hosts: "{{ report_server }}"
|
|
become: true
|
|
vars:
|
|
report_server: node1
|
|
web_path: /var/www/html/reports/
|
|
|
|
tasks:
|
|
- name: Build report server
|
|
ansible.builtin.include_role:
|
|
name: "{{ item }}"
|
|
loop:
|
|
- demo.patching.report_server
|
|
- demo.patching.build_report_network
|
|
|
|
- name: Update landing page
|
|
ansible.builtin.include_role:
|
|
name: demo.patching.report_server
|
|
tasks_from: linux_landing_page
|