Skip to content

Commit

Permalink
moved htmlreport.png to images, cleaned up playbooks and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccarthtest committed Oct 27, 2018
1 parent 476fff7 commit 447c36b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@ The playbook
Only two modules are needed for this example. The [nxos_facts module][1] and
the [template module][5]
```
- hosts: cisco
connection: local
---
- name: build NXOS inventory report
hosts: nxos
connection: network_cli
gather_facts: False
vars:
desired_version: "7.0(3)I7(1)"
file_path: /var/www/html/generated_report.html
tasks:
- name: gathering nxos facts
nxos_facts:
provider: "{{login_info}}"
register: all_facts
- name: create HTML report
template:
src: report.j2
dest: /var/www/html/generated_report.html
dest: "{{ file_path }}"
delegate_to: localhost
run_once: true
```
Expand Down Expand Up @@ -120,7 +126,7 @@ Red Hat® Ansible® Automation consists of three products:

[1]: http://docs.ansible.com/ansible/latest/nxos_facts_module.html
[2]: http://docs.ansible.com/ansible/latest/list_of_network_modules.html
[3]: htmlreport.png
[3]: images/htmlreport.png
[4]: http://docs.ansible.com/ansible/latest/ios_facts_module.html
[5]: http://docs.ansible.com/ansible/latest/template_module.html
[6]: images/rh-ansible-automation.png
Expand Down
1 change: 1 addition & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ deprecation_warnings=False
host_key_checking = False
inventory = hosts
gathering = explicit
retry_files_enabled = False # Do not create them
[paramiko_connection]
host_key_auto_add = True
4 changes: 2 additions & 2 deletions hosts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ localhost
[mac]
192.168.2.1

[cisco]
[nxos]
n9k ansible_host=192.168.2.3
n9k2 ansible_host=192.168.2.3
n9k3 ansible_host=192.168.2.3
Expand All @@ -28,5 +28,5 @@ n9k6 ansible_host=192.168.2.3
[ios:vars]
ansible_network_os=ios

[cisco:vars]
[nxos:vars]
ansible_network_os=nxos
File renamed without changes
8 changes: 4 additions & 4 deletions inventory-ios.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
- name: build IOS XE inventory
- name: build IOS inventory report
hosts: ios
connection: network_cli
gather_facts: False

vars:
desired_ios_version: "16.06.01"
file_path: /var/www/html/inventory_report_ios.html

tasks:

- name: gathering IOS XE facts
- name: gathering IOS facts
ios_facts:
register: all_facts

- name: create HTML report
template:
src: report-ios.j2
dest: /var/www/html/inventory_report_ios.html
dest: "{{ file_path }}"
delegate_to: localhost
run_once: true
# provider: "{{login_info}}"
11 changes: 6 additions & 5 deletions inventory.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
- hosts: cisco
- name: build NXOS inventory report
hosts: nxos
connection: network_cli
gather_facts: False

vars:
desired_version: "7.0(3)I7(1)"
file_path: /var/www/html/generated_report.html

tasks:
- name: gathering nxos facts
nxos_facts:
provider: "{{login_info}}"
register: all_facts

# - debug:
# var: all_facts

- name: create HTML report
template:
src: report.j2
dest: /var/www/html/generated_report.html
dest: "{{ file_path }}"
delegate_to: localhost
run_once: true

0 comments on commit 447c36b

Please sign in to comment.