Binary file not shown.
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 168 KiB |
@@ -0,0 +1,207 @@
|
|||||||
|
p.hostname {
|
||||||
|
color: #000000;
|
||||||
|
font-weight: bolder;
|
||||||
|
font-size: large;
|
||||||
|
margin: auto;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#subtable {
|
||||||
|
background: #ebebeb;
|
||||||
|
margin: 0px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#subtable tbody tr td {
|
||||||
|
padding: 5px 5px 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#subtable thead th {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-family: "Open Sans", "Helvetica";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background:#353a40;
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: separate;
|
||||||
|
background:#fff;
|
||||||
|
@include border-radius(5px);
|
||||||
|
@include box-shadow(0px 0px 5px rgba(0,0,0,0.3));
|
||||||
|
}
|
||||||
|
|
||||||
|
.main_net_table {
|
||||||
|
margin:50px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main_net_table {
|
||||||
|
margin:50px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
thead {
|
||||||
|
@include border-radius(5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
thead th {
|
||||||
|
font-size:16px;
|
||||||
|
font-weight:400;
|
||||||
|
color:#fff;
|
||||||
|
@include text-shadow(1px 1px 0px rgba(0,0,0,0.5));
|
||||||
|
text-align:left;
|
||||||
|
padding:20px;
|
||||||
|
border-top:1px solid #858d99;
|
||||||
|
background: #353a40;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
@include border-top-left-radius(5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
@include border-top-right-radius(5px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody tr td {
|
||||||
|
font-weight:400;
|
||||||
|
color:#5f6062;
|
||||||
|
font-size:13px;
|
||||||
|
padding:20px 20px 20px 20px;
|
||||||
|
border-bottom:1px solid #e0e0e0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody tr:nth-child(2n) {
|
||||||
|
background:#f0f3f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody tr:last-child td {
|
||||||
|
border-bottom:none;
|
||||||
|
&:first-child {
|
||||||
|
@include border-bottom-left-radius(5px);
|
||||||
|
}
|
||||||
|
&:last-child {
|
||||||
|
@include border-bottom-right-radius(5px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.highlight {
|
||||||
|
background-color: yellow;
|
||||||
|
}
|
||||||
|
|
||||||
|
.expandclass {
|
||||||
|
color: #5f6062;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content{
|
||||||
|
display:none;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
width: 100%;
|
||||||
|
position: initial;
|
||||||
|
float: initial;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
height: 88px;
|
||||||
|
background-color: #171717;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-container {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
max-width: 1170px;
|
||||||
|
padding: 0;
|
||||||
|
float: initial;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-logo {
|
||||||
|
width: 137px;
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-link {
|
||||||
|
margin-left: 40px;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 15px;
|
||||||
|
font-family: 'Red Hat Text';
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-link:hover {
|
||||||
|
text-shadow: 0 0 0.02px white;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.net_info td {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.expandclass:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
color: #EE0000;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary_info {
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active, a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
|
||||||
|
border: 1px solid #5F0000;
|
||||||
|
background: #EE0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#net_content {
|
||||||
|
padding: 0px;
|
||||||
|
height: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
img.router_image {
|
||||||
|
vertical-align: middle;
|
||||||
|
padding: 0px 10px 10px 10px;
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.net_info {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.internal_label {
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
@@ -1,202 +0,0 @@
|
|||||||
p.hostname {
|
|
||||||
color: #000000;
|
|
||||||
font-weight: bolder;
|
|
||||||
font-size: large;
|
|
||||||
margin: auto;
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#subtable {
|
|
||||||
background: #ebebeb;
|
|
||||||
margin: 0px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#subtable tbody tr td {
|
|
||||||
padding: 5px 5px 5px 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#subtable thead th {
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
font-family: "Open Sans", "Helvetica";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
text-align: center;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background:#353a40;
|
|
||||||
padding: 0px;
|
|
||||||
margin: 0px;
|
|
||||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse: separate;
|
|
||||||
background:#fff;
|
|
||||||
@include border-radius(5px);
|
|
||||||
@include box-shadow(0px 0px 5px rgba(0,0,0,0.3));
|
|
||||||
}
|
|
||||||
|
|
||||||
.main_net_table {
|
|
||||||
margin:50px auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
thead {
|
|
||||||
@include border-radius(5px);
|
|
||||||
}
|
|
||||||
|
|
||||||
thead th {
|
|
||||||
font-size:16px;
|
|
||||||
font-weight:400;
|
|
||||||
color:#fff;
|
|
||||||
@include text-shadow(1px 1px 0px rgba(0,0,0,0.5));
|
|
||||||
text-align:left;
|
|
||||||
padding:20px;
|
|
||||||
border-top:1px solid #858d99;
|
|
||||||
background: #353a40;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
@include border-top-left-radius(5px);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
@include border-top-right-radius(5px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tbody tr td {
|
|
||||||
font-weight:400;
|
|
||||||
color:#5f6062;
|
|
||||||
font-size:13px;
|
|
||||||
padding:20px 20px 20px 20px;
|
|
||||||
border-bottom:1px solid #e0e0e0;
|
|
||||||
}
|
|
||||||
|
|
||||||
tbody tr:nth-child(2n) {
|
|
||||||
background:#f0f3f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
tbody tr:last-child td {
|
|
||||||
border-bottom:none;
|
|
||||||
&:first-child {
|
|
||||||
@include border-bottom-left-radius(5px);
|
|
||||||
}
|
|
||||||
&:last-child {
|
|
||||||
@include border-bottom-right-radius(5px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.highlight {
|
|
||||||
background-color: yellow;
|
|
||||||
}
|
|
||||||
|
|
||||||
.expandclass {
|
|
||||||
color: #5f6062;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content{
|
|
||||||
display:none;
|
|
||||||
margin: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
header {
|
|
||||||
width: 100%;
|
|
||||||
position: initial;
|
|
||||||
float: initial;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
height: 88px;
|
|
||||||
background-color: #171717;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-container {
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
max-width: 1170px;
|
|
||||||
padding: 0;
|
|
||||||
float: initial;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-logo {
|
|
||||||
width: 137px;
|
|
||||||
border: 0;
|
|
||||||
margin: 0;
|
|
||||||
margin-left: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-link {
|
|
||||||
margin-left: 40px;
|
|
||||||
text-decoration: none;
|
|
||||||
cursor: pointer;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-size: 15px;
|
|
||||||
font-family: 'Red Hat Text';
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-link:hover {
|
|
||||||
text-shadow: 0 0 0.02px white;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.net_info td {
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.expandclass:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
color: #EE0000;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary_info {
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active, a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
|
|
||||||
border: 1px solid #5F0000;
|
|
||||||
background: #EE0000;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#net_content {
|
|
||||||
padding: 0px;
|
|
||||||
height: auto !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.router_image {
|
|
||||||
vertical-align: middle;
|
|
||||||
padding: 0px 10px 10px 10px;
|
|
||||||
width: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.net_info {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.internal_label {
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,21 @@
|
|||||||
|
- name: Create web directory if it does not exist
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ file_path }}"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
- name: create HTML report
|
- name: create HTML report
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: report.j2
|
src: report.j2
|
||||||
dest: "{{ file_path }}/network.html"
|
dest: "{{ file_path }}/network.html"
|
||||||
|
check_mode: no
|
||||||
|
|
||||||
- name: copy CSS over
|
- name: copy CSS over
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "css"
|
src: "css"
|
||||||
dest: "{{ file_path }}"
|
dest: "{{ file_path }}"
|
||||||
directory_mode: true
|
directory_mode: true
|
||||||
|
check_mode: no
|
||||||
|
|
||||||
- name: copy logos over
|
- name: copy logos over
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
@@ -18,7 +26,8 @@
|
|||||||
- "webpage_logo.png"
|
- "webpage_logo.png"
|
||||||
- "redhat-ansible-logo.svg"
|
- "redhat-ansible-logo.svg"
|
||||||
- "router.png"
|
- "router.png"
|
||||||
|
check_mode: no
|
||||||
|
|
||||||
- name: display link to inventory report
|
# - name: Display link to Linux patch report
|
||||||
ansible.builtin.debug:
|
# ansible.builtin.debug:
|
||||||
msg: "Please go to http://{{ ansible_host }}/network.html"
|
# msg: "Please go to http://{{ hostvars[report_server]['ansible_host'] }}/reports/network.html"
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<!-- INTERNAL TABLE FOR Ansible -->
|
||||||
|
<div id="accordion">
|
||||||
|
<div>
|
||||||
|
<h3>Ansible Automation Info</h3>
|
||||||
|
<div class="net_content">
|
||||||
|
<table class="net_info">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Ansible user</td>
|
||||||
|
<td class="sub_net_info">{{ hostvars[network_switch]['ansible_user'] }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Transport</td>
|
||||||
|
<td class="sub_net_info">{% set ansible_connection = hostvars[network_switch]['ansible_net_api'] %}{{ transport[ansible_connection] }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Ansible Mgmt IP</td>
|
||||||
|
<td class="sub_net_info">{{ hostvars[network_switch]['ansible_host'] | default('N/A') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Ansible groups</td>
|
||||||
|
<td class="sub_net_info">{% for group in hostvars[network_switch]['group_names'] %}{{ group }} {% endfor %}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Ansible core version</td>
|
||||||
|
<td class="sub_net_info">{% for group in hostvars[network_switch]['ansible_version']['string']|default("Unknown") %}{{ group }} {% endfor %}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Ansible Python</td>
|
||||||
|
<td class="sub_net_info">{{ hostvars[network_switch]['ansible_playbook_python']|default("Unknown") }} </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Python version</td>
|
||||||
|
<td class="sub_net_info">{{ hostvars[network_switch]['ansible_net_python_version']|default("Unknown") }} </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END INTERNAL TABLE FOR Ansible -->
|
||||||
@@ -1,25 +1,46 @@
|
|||||||
<!–– INTERNAL TABLE FOR BGP --!>
|
<!-- INTERNAL TABLE FOR BGP -->
|
||||||
<div id="accordion">
|
<div id="accordion">
|
||||||
<div class="ui-accordion ui-widget ui-helper-reset" role="tablist">
|
<div>
|
||||||
<h3 class="ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all" role="tab" id="ui-id-3" aria-controls="ui-id-4" aria-selected="false" aria-expanded="false" tabindex="0">BGP Global Info</h3>
|
<h3>BGP Global Info</h3>
|
||||||
<div class="net_content ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-4" aria-labelledby="ui-id-3" role="tabpanel" aria-hidden="true" style="display: none; height: 194px;">
|
<div class="net_content">
|
||||||
{% if hostvars[network_switch]['ansible_network_resources']['bgp_global'] is defined and hostvars[network_switch]['ansible_network_resources']['bgp_global']|length > 0 %}
|
{% if hostvars[network_switch]['ansible_network_resources']['bgp_global'] is defined and hostvars[network_switch]['ansible_network_resources']['bgp_global']|length > 0 %}
|
||||||
<table id="subtable">
|
<table id="subtable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ASN</th>
|
<th>ASN</th>
|
||||||
<th>Router ID</th>
|
<th>Router ID</th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for bgpinfo in hostvars[network_switch]['ansible_network_resources']['bgp_global'] %}
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{bgpinfo['as_number']}}</td>
|
<td>{{ hostvars[network_switch].ansible_network_resources.bgp_global['as_number']|default("Not Configured") }}</td>
|
||||||
<td>{{bgpinfo['router_id']|default("Not Configured")}}</td>
|
<td>{{ hostvars[network_switch].ansible_network_resources.bgp_global.bgp['router_id']['address']|default("Not Configured") }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
{% if hostvars[network_switch]['ansible_network_resources']['bgp_global'][
|
||||||
|
'neighbor'] is defined and hostvars[network_switch]['ansible_network_resources']['bgp_global'][
|
||||||
|
'neighbor']|length > 0 %}
|
||||||
|
<p class="internal_label">BGP Neighbors</p>
|
||||||
|
<table id="subtable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Address</th>
|
||||||
|
<th>Remote AS</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for bgp_neighbor in hostvars[network_switch].ansible_network_resources.bgp_global.neighbor %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ bgp_neighbor['address']|default("Not Configured") }}</td>
|
||||||
|
<td>{{ bgp_neighbor['remote_as']|default("Not Configured") }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% endif %}
|
||||||
{% elif hostvars[network_switch]['ansible_network_resources']['bgp_global'] is defined and hostvars[network_switch]['ansible_network_resources']['bgp_global']|length == 0 %}
|
{% elif hostvars[network_switch]['ansible_network_resources']['bgp_global'] is defined and hostvars[network_switch]['ansible_network_resources']['bgp_global']|length == 0 %}
|
||||||
BGP is not configured on this device
|
BGP is not configured on this device
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -28,4 +49,4 @@ No BGP information available
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!–– END INTERNAL TABLE FOR BGP --!>
|
<!-- END INTERNAL TABLE FOR BGP -->
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<!-- INTERNAL TABLE FOR BGP -->
|
||||||
|
<div id="accordion">
|
||||||
|
<div>
|
||||||
|
<h3>BGP Address Family</h3>
|
||||||
|
<div class="net_content">
|
||||||
|
{% if hostvars[network_switch]['ansible_network_resources']['bgp_address_family']['address_family'] is defined and hostvars[network_switch]['ansible_network_resources']['bgp_address_family']['address_family']|length > 0 %}
|
||||||
|
|
||||||
|
{% for address_family in hostvars[network_switch]['ansible_network_resources']['bgp_address_family']['address_family'] %}
|
||||||
|
<p class="internal_label">Address Family {{ address_family['afi'] }}</p>
|
||||||
|
<table id="subtable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Network</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% if hostvars[network_switch]['ansible_network_resources']['bgp_address_family']['address_family']['networks'] is defined %}
|
||||||
|
{% for bgp_network in address_family['networks'] %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ bgp_network['prefix']|default("Not Configured") }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
{% elif hostvars[network_switch]['ansible_network_resources']['bgp_address_family']['address_family']['network'] is defined %}
|
||||||
|
{% for bgp_network in address_family['network'] %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ bgp_network['address']|default("Not Configured") }}</td>
|
||||||
|
<td>{{ bgp_network['mask']|default("Not Configured") }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
No BGP networks information available
|
||||||
|
{% endif %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% elif hostvars[network_switch]['ansible_network_resources']['bgp_address_family']['address_family'] is defined and hostvars[network_switch]['ansible_network_resources']['bgp_address_family']['address_family']|length == 0 %}
|
||||||
|
no BGP address-family is not configured on this device
|
||||||
|
{% else %}
|
||||||
|
No BGP information available
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END INTERNAL TABLE FOR BGP -->
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<header>
|
<header>
|
||||||
<div class="header-container">
|
<div class="header-container">
|
||||||
@@ -12,4 +10,4 @@
|
|||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
<!–– INTERNAL TABLE FOR INTERFACES --!>
|
<!-- INTERNAL TABLE FOR INTERFACES -->
|
||||||
<div id="accordion">
|
<div id="accordion">
|
||||||
<div class="ui-accordion ui-widget ui-helper-reset" role="tablist">
|
<div>
|
||||||
<h3 class="ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all" role="tab" id="ui-id-3" aria-controls="ui-id-4" aria-selected="false" aria-expanded="false" tabindex="0">
|
<h3>Interfaces - MTU/Duplex/Speed</h3>
|
||||||
Interfaces - MTU/Duplex/Speed
|
<div class="net_content">
|
||||||
</h3>
|
|
||||||
<div class="net_content ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-4" aria-labelledby="ui-id-3" role="tabpanel" aria-hidden="true" style="display: none; height: 194px;">
|
|
||||||
{% if hostvars[network_switch]['ansible_network_resources']['interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['interfaces']|length > 0 %}
|
{% if hostvars[network_switch]['ansible_network_resources']['interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['interfaces']|length > 0 %}
|
||||||
<table id="subtable">
|
<table id="subtable">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -23,7 +21,7 @@
|
|||||||
<td>{{interface['name']}}</td>
|
<td>{{interface['name']}}</td>
|
||||||
<td>{{interface['description']|default("none")}}</td>
|
<td>{{interface['description']|default("none")}}</td>
|
||||||
<td>{{interface['duplex']|default("default")}}</td>
|
<td>{{interface['duplex']|default("default")}}</td>
|
||||||
<td>{{interface['enabled']}}</td>
|
<td>{{interface['enabled']|default("N/A")}}</td>
|
||||||
<td>{{interface['mtu']|default("default")}}</td>
|
<td>{{interface['mtu']|default("default")}}</td>
|
||||||
<td>{{interface['speed']|default("default")}}</td>
|
<td>{{interface['speed']|default("default")}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -38,4 +36,4 @@ No Interface information available
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!–– END INTERNAL TABLE FOR INTERFACES --!>
|
<!-- END INTERNAL TABLE FOR INTERFACES -->
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!–– INTERNAL TABLE FOR l2_interfaces --!>
|
<!-- INTERNAL TABLE FOR l2_interfaces -->
|
||||||
<div id="accordion">
|
<div id="accordion">
|
||||||
<div class="ui-accordion ui-widget ui-helper-reset" role="tablist">
|
<div>
|
||||||
<h3 class="ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all" role="tab" id="ui-id-3" aria-controls="ui-id-4" aria-selected="false" aria-expanded="false" tabindex="0">L2 Interfaces - Trunk/Access Ports</h3>
|
<h3>L2 Interfaces - Trunk/Access Ports</h3>
|
||||||
<div class="net_content ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-4" aria-labelledby="ui-id-3" role="tabpanel" aria-hidden="true" style="display: none; height: 194px;">
|
<div class="net_content">
|
||||||
{% if hostvars[network_switch]['ansible_network_resources']['l2_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['l2_interfaces']|length > 0 %}
|
{% if hostvars[network_switch]['ansible_network_resources']['l2_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['l2_interfaces']|length > 0 %}
|
||||||
<table id="subtable">
|
<table id="subtable">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -34,4 +34,4 @@ No L2 information available
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!–– END INTERNAL TABLE FOR l2_interfaces --!>
|
<!-- END INTERNAL TABLE FOR l2_interfaces -->
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!–– INTERNAL TABLE FOR L3_INTERFACES --!>
|
<!-- INTERNAL TABLE FOR L3_INTERFACES -->
|
||||||
<div id="accordion">
|
<div id="accordion">
|
||||||
<div class="ui-accordion ui-widget ui-helper-reset" role="tablist">
|
<div>
|
||||||
<h3 class="ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all" role="tab" id="ui-id-3" aria-controls="ui-id-4" aria-selected="false" aria-expanded="false" tabindex="0">L3 Interfaces - IP Addresses</h3>
|
<h3>L3 Interfaces - IP Addresses</h3>
|
||||||
<div class="net_content ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-4" aria-labelledby="ui-id-3" role="tabpanel" aria-hidden="true" style="display: none; height: 194px;">
|
<div class="net_content">
|
||||||
{% if hostvars[network_switch]['ansible_network_resources']['l3_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['l3_interfaces']|length > 0 %}
|
{% if hostvars[network_switch]['ansible_network_resources']['l3_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['l3_interfaces']|length > 0 %}
|
||||||
<table id="subtable">
|
<table id="subtable">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -16,15 +16,11 @@
|
|||||||
{% for interface in hostvars[network_switch]['ansible_network_resources']['l3_interfaces'] %}
|
{% for interface in hostvars[network_switch]['ansible_network_resources']['l3_interfaces'] %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{interface['name']}}</td>
|
<td>{{interface['name']}}</td>
|
||||||
<!–– INTERNAL IPv4 LOOP FOR L3_INTERFACES --!>
|
<!-- INTERNAL IPv4 LOOP FOR L3_INTERFACES -->
|
||||||
<td>
|
<td>
|
||||||
{% if interface.ipv4 is defined %}
|
{% if interface.ipv4 is defined %}
|
||||||
{% for address in interface.ipv4 %}
|
{% for address in interface.ipv4 %}
|
||||||
{% if address['address'] is defined %}
|
{{ address['address']|default("Not Configured") }}
|
||||||
{{address['address']}}
|
|
||||||
{% else %}
|
|
||||||
dhcp
|
|
||||||
{% endif %}
|
|
||||||
{% if address['secondary'] is defined %}
|
{% if address['secondary'] is defined %}
|
||||||
secondary
|
secondary
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -32,17 +28,17 @@ secondary
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<!–– END IPv4 INTERNAL LOOP FOR L3_INTERFACES --!>
|
<!-- END IPv4 INTERNAL LOOP FOR L3_INTERFACES -->
|
||||||
<!–– INTERNAL IPv6 LOOP FOR L3_INTERFACES --!>
|
<!-- INTERNAL IPv6 LOOP FOR L3_INTERFACES -->
|
||||||
<td>
|
<td>
|
||||||
{% if interface.ipv6 is defined %}
|
{% if interface.ipv6 is defined %}
|
||||||
{% for v6address in interface.ipv6 %}
|
{% for v6address in interface.ipv6 %}
|
||||||
{{v6address['address']}}
|
{{v6address['address']|default("Not Configured") }}
|
||||||
{% if loop.length > 1 and not loop.last %}<br>{% endif %}
|
{% if loop.length > 1 and not loop.last %}<br>{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<!–– END INTERNAL LOOP FOR L3_INTERFACES --!>
|
<!-- END INTERNAL LOOP FOR L3_INTERFACES -->
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -55,4 +51,4 @@ No L3 information available
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!–– END INTERNAL TABLE FOR L3_INTERFACES --!>
|
<!-- END INTERNAL TABLE FOR L3_INTERFACES -->
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!–– INTERNAL TABLE FOR LACP --!>
|
<!-- INTERNAL TABLE FOR LACP -->
|
||||||
<div id="accordion">
|
<div id="accordion">
|
||||||
<div class="ui-accordion ui-widget ui-helper-reset" role="tablist">
|
<div>
|
||||||
<h3 class="ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all" role="tab" id="ui-id-3" aria-controls="ui-id-4" aria-selected="false" aria-expanded="false" tabindex="0">LACP</h3>
|
<h3>LACP</h3>
|
||||||
<div class="net_content ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-4" aria-labelledby="ui-id-3" role="tabpanel" aria-hidden="true" style="display: none; height: 194px;">
|
<div class="net_content">
|
||||||
{% if hostvars[network_switch]['ansible_network_resources']['lacp'] is defined and hostvars[network_switch]['ansible_network_resources']['lacp'].keys()|length > 0 %}
|
{% if hostvars[network_switch]['ansible_network_resources']['lacp'] is defined and hostvars[network_switch]['ansible_network_resources']['lacp'].keys()|length > 0 %}
|
||||||
<table id="subtable">
|
<table id="subtable">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -11,14 +11,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
{% for property in hostvars[network_switch]['ansible_network_resources']['lacp'] %}
|
||||||
<tr>
|
<tr>
|
||||||
{% if hostvars[network_switch]['ansible_network_resources']['lacp']['system'] is defined %}
|
<td>{% if property['system'] is defined %} }{{property['system']['priority']}}{% else %}LACP not configured {% endif %}</td>
|
||||||
<td> {{hostvars[network_switch]['ansible_network_resources']['lacp']['system']['priority']}}</td>
|
|
||||||
{% endif %}
|
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% elif hostvars[network_switch]['ansible_network_resources']['lacp'] is defined and hostvars[network_switch]['ansible_network_resources']['lacp']|length == 0 %}
|
{% elif hostvars[network_switch]['ansible_network_resources']['lacp'] is defined and hostvars[network_switch]['ansible_network_resources']['lacp'].keys()|length == 0 %}
|
||||||
LACP is not configured on this device
|
LACP is not configured on this device
|
||||||
{% else %}
|
{% else %}
|
||||||
No LACP information available
|
No LACP information available
|
||||||
@@ -26,4 +26,4 @@ No LACP information available
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!–– END INTERNAL TABLE FOR LACP --!>
|
<!-- END INTERNAL TABLE FOR LACP -->
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<!–– INTERNAL TABLE FOR lldp_interfaces --!>
|
<!-- INTERNAL TABLE FOR lldp_interfaces -->
|
||||||
<div id="accordion">
|
<div id="accordion">
|
||||||
<div class="ui-accordion ui-widget ui-helper-reset" role="tablist">
|
<div>
|
||||||
<h3 class="ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all" role="tab" id="ui-id-3" aria-controls="ui-id-4" aria-selected="false" aria-expanded="false" tabindex="0">LLDP Interfaces</h3>
|
<h3>LLDP Interfaces</h3>
|
||||||
<div class="net_content ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-4" aria-labelledby="ui-id-3" role="tabpanel" aria-hidden="true" style="display: none; height: 194px;">
|
<div class="net_content">
|
||||||
{% if hostvars[network_switch]['ansible_network_resources']['lldp_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['lldp_interfaces']|length > 0 %}
|
{% if hostvars[network_switch]['ansible_network_resources']['lldp_interfaces'] is defined %}
|
||||||
<table id="subtable">
|
<table id="subtable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -22,12 +22,10 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% elif hostvars[network_switch]['ansible_network_resources']['lldp_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['lldp_interfaces'].keys()|length == 0 %}
|
|
||||||
LLDP is not configured on this device
|
|
||||||
{% else %}
|
{% else %}
|
||||||
No LLDP information available
|
No LLDP information available
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!–– END INTERNAL TABLE FOR lldp_interfaces --!>
|
<!-- END INTERNAL TABLE FOR lldp_interfaces -->
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!–– INTERNAL TABLE FOR OSPF --!>
|
<!-- INTERNAL TABLE FOR OSPF -->
|
||||||
<div id="accordion">
|
<div id="accordion">
|
||||||
<div class="ui-accordion ui-widget ui-helper-reset" role="tablist">
|
<div>
|
||||||
<h3 class="ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all" role="tab" id="ui-id-3" aria-controls="ui-id-4" aria-selected="false" aria-expanded="false" tabindex="0">OSPF Global Info</h3>
|
<h3>OSPF Global Info</h3>
|
||||||
<div class="net_content ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-4" aria-labelledby="ui-id-3" role="tabpanel" aria-hidden="true" style="display: none; height: 194px;">
|
<div class="net_content">
|
||||||
{% if hostvars[network_switch]['ansible_network_resources']['ospfv2'] is defined and hostvars[network_switch]['ansible_network_resources']['ospfv2']|length > 0 %}
|
{% if hostvars[network_switch]['ansible_network_resources']['ospfv2'] is defined and hostvars[network_switch]['ansible_network_resources']['ospfv2']|length > 0 %}
|
||||||
<table id="subtable">
|
<table id="subtable">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -12,10 +12,12 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
{% for key,value in hostvars[network_switch]['ansible_network_resources']['ospfv2'].items() %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>1</td>
|
<td>{{ value[0].process_id }}</td>
|
||||||
<td>{{ hostvars[network_switch]['ansible_network_resources']['ospfv2']['parameters']['router_id'] }}</td>
|
<td>{{ value[0].router_id|default("Not Configured") }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% elif hostvars[network_switch]['ansible_network_resources']['ospfv2'] is defined and hostvars[network_switch]['ansible_network_resources']['ospfv2']|length == 0 %}
|
{% elif hostvars[network_switch]['ansible_network_resources']['ospfv2'] is defined and hostvars[network_switch]['ansible_network_resources']['ospfv2']|length == 0 %}
|
||||||
@@ -26,4 +28,4 @@ No OSPF information available
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!–– END INTERNAL TABLE FOR OSPF --!>
|
<!-- END INTERNAL TABLE FOR OSPF -->
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title> Ansible Network Automation Report </title>
|
<title>Network Automation Report</title>
|
||||||
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
|
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
|
||||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||||
<link rel="stylesheet" href="css/new.css">
|
<link rel="stylesheet" href="css/main.css">
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
||||||
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#accordion > div" ).accordion({
|
$( "#accordion > div" ).accordion({
|
||||||
@@ -17,55 +16,14 @@ collapsible: true
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
|
||||||
(function(document) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var TableFilter = (function(myArray) {
|
|
||||||
var search_input;
|
|
||||||
|
|
||||||
function _onInputSearch(e) {
|
|
||||||
search_input = e.target;
|
|
||||||
var tables = document.getElementsByClassName(search_input.getAttribute('data-table'));
|
|
||||||
myArray.forEach.call(tables, function(table) {
|
|
||||||
myArray.forEach.call(table.tBodies, function(tbody) {
|
|
||||||
myArray.forEach.call(tbody.rows, function(row) {
|
|
||||||
var text_content = row.textContent.toLowerCase();
|
|
||||||
var search_val = search_input.value.toLowerCase();
|
|
||||||
row.style.display = text_content.indexOf(search_val) > -1 ? '' : 'none';
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
init: function() {
|
|
||||||
var inputs = document.getElementsByClassName('search-input');
|
|
||||||
myArray.forEach.call(inputs, function(input) {
|
|
||||||
input.oninput = _onInputSearch;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})(Array.prototype);
|
|
||||||
|
|
||||||
document.addEventListener('readystatechange', function() {
|
|
||||||
if (document.readyState === 'complete') {
|
|
||||||
TableFilter.init();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
})(document);
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="wrapper">
|
|
||||||
{% include 'header.j2' %}
|
{% include 'header.j2' %}
|
||||||
<section>
|
<section>
|
||||||
<center>
|
<center>
|
||||||
<h1>Ansible Network Automation Report</h1>
|
<h1>Ansible Network Automation Example Report</h1>
|
||||||
<h3><input type="search" placeholder="Search..." class="form-control search-input" data-table="main_net_table"/>
|
|
||||||
</center>
|
</center>
|
||||||
<table class="table table-striped mt32 main_net_table">
|
<table class="main_net_table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Network Device</th>
|
<th>Network Device</th>
|
||||||
@@ -75,35 +33,71 @@ collapsible: true
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for network_switch in groups['tag_Router']|sort %}
|
{% for network_switch in groups['routers']|sort %}
|
||||||
|
{% if hostvars[network_switch].ansible_facts.network_resources is defined %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="summary_info">
|
<td class="summary_info">
|
||||||
<div id="hostname">
|
<div id="hostname">
|
||||||
<p class="hostname">
|
<p class="hostname"><img class="router_image" src="router.png" alt="picture of network device">{{ hostvars[network_switch].ansible_net_hostname }}</p>
|
||||||
<img class="router_image" src="router.png"> {{ hostvars[network_switch]['ansible_net_hostname'].split('.')[0] }}</p>
|
</div>
|
||||||
</div>
|
<div id="net_info_div">
|
||||||
{% include 'summary.j2' %}
|
<table class="net_info">
|
||||||
</td>
|
<tbody>
|
||||||
<td>
|
<tr>
|
||||||
{% include 'interfaces.j2' %}
|
<td>Platform</td>
|
||||||
</td>
|
<td class="sub_net_info">{% set ansible_network_os = hostvars[network_switch]['ansible_net_system'] %}{{ vendor[ansible_network_os]}} {{hostvars[network_switch]['ansible_net_system'] }}</td>
|
||||||
<td>
|
</tr>
|
||||||
{% include 'vlans.j2' %}
|
<tr>
|
||||||
{% include 'lldp_interfaces.j2' %}
|
<td>Code Version</td>
|
||||||
{% include 'l2_interfaces.j2' %}
|
<td class="sub_net_info">{{ hostvars[network_switch]['ansible_net_version'] }}</td>
|
||||||
</td>
|
</tr>
|
||||||
<td>
|
<tr>
|
||||||
{% include 'l3_interfaces.j2' %}
|
<td>Model</td>
|
||||||
{% include 'lacp.j2' %}
|
<td class="sub_net_info">{{ hostvars[network_switch]['ansible_net_model'] }}</td>
|
||||||
{% include 'bgp.j2' %}
|
</tr>
|
||||||
{% include 'ospf.j2' %}
|
<tr>
|
||||||
</td>
|
<td>Serial Number</td>
|
||||||
|
<td class="sub_net_info">{{ hostvars[network_switch]['ansible_net_serialnum'] | default('N/A') }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
{% include 'ansible.j2' %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{% include 'interfaces.j2' %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% include 'vlans.j2' %}
|
||||||
|
{% include 'lldp_interfaces.j2' %}
|
||||||
|
{% include 'l2_interfaces.j2' %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% include 'l3_interfaces.j2' %}
|
||||||
|
{% include 'lacp.j2' %}
|
||||||
|
{% include 'static.j2' %}
|
||||||
|
{% include 'bgp.j2' %}
|
||||||
|
{% include 'bgp_address_family.j2' %}
|
||||||
|
{% include 'ospf.j2' %}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<center><p>Created with</p><br><img src="webpage_logo.png" width="300">
|
<center><p>Created with</p><br><img src="webpage_logo.png" width="300" alt="red hat ansible automation platform logo">
|
||||||
|
<p>The source code to create this report can be found at <a href="https://github.com/network-automation/toolkit">https://github.com/network-automation/toolkit</a><br><br>
|
||||||
|
If you are new to Ansible Automation check out the following links:<br>
|
||||||
|
<a href="https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html">Getting Started</a><br>
|
||||||
|
<a target="_blank" href="https://ansible.com/workshops">Free hands-on workshops</a><br>
|
||||||
|
<a href="https://youtube.com/ansibleautomation">Youtube Videos</a><br>
|
||||||
|
</p>
|
||||||
</center>
|
</center>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<!-- INTERNAL TABLE FOR Static Routes -->
|
||||||
|
<div id="accordion">
|
||||||
|
<div>
|
||||||
|
<h3>Static Routes</h3>
|
||||||
|
<div class="net_content">
|
||||||
|
{% if hostvars[network_switch]['ansible_network_resources']['static_routes'] is defined and hostvars[network_switch]['ansible_network_resources']['static_routes']|length > 0 %}
|
||||||
|
<table id="subtable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>VRF</th>
|
||||||
|
<th>Address-Family</th>
|
||||||
|
<th>Route</th>
|
||||||
|
<th>Interface</th>
|
||||||
|
<th>Next-Hop Address</th>
|
||||||
|
<th>Global</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for net_route in hostvars[network_switch]['ansible_network_resources']['static_routes'] %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ net_route['vrf']|default("N/A") }}</td>
|
||||||
|
{% for address_family in net_route.address_families|default([]) %}
|
||||||
|
<td>{{ address_family['afi'] }}</td>
|
||||||
|
{% for routes in address_family['routes'] %}
|
||||||
|
<td>{{ routes['dest'] }}</td>
|
||||||
|
{% for next_hops in routes['next_hops'] %}
|
||||||
|
<td>{{ next_hops['interface']|default("N/A") }}</td>
|
||||||
|
<td>{{ next_hops['forward_router_address']|default("N/A") }}</td>
|
||||||
|
<td>{{ next_hops['global']|default("N/A") }}</td>
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% elif hostvars[network_switch]['ansible_network_resources']['static_routes'] is defined and hostvars[network_switch]['ansible_network_resources']['static_routes']|length == 0 %}
|
||||||
|
Static Routes are not configured on this device
|
||||||
|
{% else %}
|
||||||
|
No Static Route information available
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END INTERNAL TABLE FOR Static Routes -->
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
<div id="net_info_div">
|
|
||||||
<table class="net_info">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>Platform</td>
|
|
||||||
<td class="sub_net_info">{{hostvars[network_switch]['ansible_net_system']}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Code Version</td>
|
|
||||||
<td class="sub_net_info">{{hostvars[network_switch]['ansible_net_version']}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Model</td>
|
|
||||||
<td class="sub_net_info">{{hostvars[network_switch]['ansible_net_model']|default("N/A")}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Serial Number</td>
|
|
||||||
<td class="sub_net_info">{{hostvars[network_switch]['ansible_net_serialnum']}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Transport</td>
|
|
||||||
<td class="sub_net_info">{{hostvars[network_switch]['ansible_net_api']}}</td>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<!–– INTERNAL TABLE FOR VLANS --!>
|
<!-- INTERNAL TABLE FOR VLANS -->
|
||||||
<div id="accordion">
|
<div id="accordion">
|
||||||
<div class="ui-accordion ui-widget ui-helper-reset" role="tablist">
|
<div>
|
||||||
<h3 class="ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all" role="tab" id="ui-id-3" aria-controls="ui-id-4" aria-selected="false" aria-expanded="false" tabindex="0">VLANs</h3>
|
<h3>VLANs</h3>
|
||||||
<div class="net_content ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-4" aria-labelledby="ui-id-3" role="tabpanel" aria-hidden="true" style="display: none; height: 194px;">
|
<div class="net_content">
|
||||||
{% if hostvars[network_switch]['ansible_network_resources']['vlans'] is defined and hostvars[network_switch]['ansible_network_resources']['vlans']|length > 0 %}
|
{% if hostvars[network_switch]['ansible_network_resources']['vlans'] is defined and hostvars[network_switch]['ansible_network_resources']['vlans']|length > 0 %}
|
||||||
<table id="subtable">
|
<table id="subtable">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -30,4 +30,4 @@ No VLAN information available
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!–– END INTERNAL TABLE FOR VLANS --!>
|
<!-- END INTERNAL TABLE FOR VLANS -->
|
||||||
|
|||||||
@@ -1 +1,11 @@
|
|||||||
file_path: /var/www/html
|
file_path: "{{ web_path | default('/var/www/html/reports') }}"
|
||||||
|
vendor:
|
||||||
|
ios: &my_value 'Cisco'
|
||||||
|
nxos: *my_value
|
||||||
|
iosxr: *my_value
|
||||||
|
junos: "Juniper"
|
||||||
|
eos: "Arista"
|
||||||
|
transport:
|
||||||
|
cliconf: "Network_CLI"
|
||||||
|
netconf: "NETCONF"
|
||||||
|
nxapi: "NX-API"
|
||||||
@@ -23,3 +23,11 @@ collections:
|
|||||||
version: 1.13.0
|
version: 1.13.0
|
||||||
- name: amazon.aws
|
- name: amazon.aws
|
||||||
version: 3.1.1
|
version: 3.1.1
|
||||||
|
#network
|
||||||
|
- name: cisco.ios
|
||||||
|
version: 3.1.0
|
||||||
|
- name: cisco.nxos
|
||||||
|
version: 3.0.0
|
||||||
|
- name: cisco.iosxr
|
||||||
|
version: 3.0.0
|
||||||
|
|
||||||
|
|||||||
58
network/report.yml
Normal file
58
network/report.yml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
---
|
||||||
|
# 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 }}"
|
||||||
|
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)}}"
|
||||||
|
|
||||||
|
- hosts: node1
|
||||||
|
become: yes
|
||||||
|
vars:
|
||||||
|
report_server: node1
|
||||||
|
web_path: /var/www/html/reports/
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- ansible.builtin.include_role:
|
||||||
|
name: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- demo.patching.report_server
|
||||||
|
- demo.patching.build_report_network
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- ansible.builtin.include_role:
|
||||||
|
name: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- demo.patching.report_server
|
||||||
|
- demo.patching.build_report_network
|
||||||
|
|
||||||
|
- ansible.builtin.include_role:
|
||||||
|
name: demo.patching.report_server
|
||||||
|
tasks_from: linux_landing_page
|
||||||
|
delegate_to: "{{ report_server }}"
|
||||||
|
run_once: yes
|
||||||
@@ -2,22 +2,16 @@
|
|||||||
user_message:
|
user_message:
|
||||||
|
|
||||||
controller_components:
|
controller_components:
|
||||||
- organizations
|
|
||||||
- projects
|
- projects
|
||||||
- inventories
|
- inventories
|
||||||
|
- hosts
|
||||||
- inventory_sources
|
- inventory_sources
|
||||||
- inventory_source_update
|
- inventory_source_update
|
||||||
- job_templates
|
- job_templates
|
||||||
|
|
||||||
controller_organizations:
|
|
||||||
- name: Networking
|
|
||||||
galaxy_credentials:
|
|
||||||
- Automation Hub
|
|
||||||
- Ansible Galaxy
|
|
||||||
|
|
||||||
controller_projects:
|
controller_projects:
|
||||||
- name: Network Golden Configs
|
- name: Network Golden Configs
|
||||||
organization: Networking
|
organization: Default
|
||||||
scm_type: git
|
scm_type: git
|
||||||
scm_url: https://github.com/nleiva/ansible-net-modules
|
scm_url: https://github.com/nleiva/ansible-net-modules
|
||||||
update_project: yes
|
update_project: yes
|
||||||
@@ -25,7 +19,7 @@ controller_projects:
|
|||||||
|
|
||||||
controller_inventories:
|
controller_inventories:
|
||||||
- name: Network Inventory
|
- name: Network Inventory
|
||||||
organization: Networking
|
organization: Default
|
||||||
|
|
||||||
controller_inventory_sources:
|
controller_inventory_sources:
|
||||||
- name: DevNet always-on sandboxes
|
- name: DevNet always-on sandboxes
|
||||||
@@ -35,9 +29,16 @@ controller_inventory_sources:
|
|||||||
source_project: Network Golden Configs
|
source_project: Network Golden Configs
|
||||||
source_path: hosts
|
source_path: hosts
|
||||||
|
|
||||||
|
controller_hosts:
|
||||||
|
- name: node1
|
||||||
|
inventory: Network Inventory
|
||||||
|
variables:
|
||||||
|
ansible_user: rhel
|
||||||
|
ansible_host: node1
|
||||||
|
|
||||||
controller_templates:
|
controller_templates:
|
||||||
- name: NETWORK / Configuration
|
- name: NETWORK / Configuration
|
||||||
organization: Networking
|
organization: Default
|
||||||
inventory: Network Inventory
|
inventory: Network Inventory
|
||||||
survey_enabled: true
|
survey_enabled: true
|
||||||
project: Network Golden Configs
|
project: Network Golden Configs
|
||||||
@@ -67,3 +68,32 @@ controller_templates:
|
|||||||
- prefix_lists
|
- prefix_lists
|
||||||
- snmp
|
- snmp
|
||||||
- user
|
- user
|
||||||
|
|
||||||
|
- name: "NETWORK / Report"
|
||||||
|
job_type: check
|
||||||
|
organization: Default
|
||||||
|
inventory: Network Inventory
|
||||||
|
project: "Ansible official demo project"
|
||||||
|
playbook: "network/report.yml"
|
||||||
|
notification_templates_started: Telemetry
|
||||||
|
notification_templates_success: Telemetry
|
||||||
|
notification_templates_error: Telemetry
|
||||||
|
use_fact_cache: true
|
||||||
|
ask_job_type_on_launch: yes
|
||||||
|
credentials:
|
||||||
|
- "Workshop Credential"
|
||||||
|
survey_enabled: true
|
||||||
|
survey:
|
||||||
|
name: ''
|
||||||
|
description: ''
|
||||||
|
spec:
|
||||||
|
- question_name: What devices do you want to include in the report?
|
||||||
|
type: multiplechoice
|
||||||
|
variable: HOSTS
|
||||||
|
default: routers
|
||||||
|
required: true
|
||||||
|
choices:
|
||||||
|
- sandbox-iosxe-latest-1.cisco.com
|
||||||
|
- sandbox-iosxr-1.cisco.com
|
||||||
|
- sandbox-nxos-1.cisco.com
|
||||||
|
- routers
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
---
|
---
|
||||||
- hosts: localhost
|
- name: Setup demo
|
||||||
gather_facts: no
|
hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Default Components
|
- name: Default Components
|
||||||
include_role:
|
ansible.builtin.include_role:
|
||||||
name: "redhat_cop.controller_configuration.{{ item }}"
|
name: "redhat_cop.controller_configuration.{{ item }}"
|
||||||
loop: "{{ controller_components }}"
|
loop: "{{ controller_components }}"
|
||||||
vars:
|
vars:
|
||||||
@@ -48,10 +49,10 @@
|
|||||||
value: 180000
|
value: 180000
|
||||||
|
|
||||||
- name: "include configuration for {{ demo }}"
|
- name: "include configuration for {{ demo }}"
|
||||||
include_vars: "{{demo}}/setup.yml"
|
ansible.builtin.include_vars: "{{ demo }}/setup.yml"
|
||||||
|
|
||||||
- name: Demo Components
|
- name: Demo Components
|
||||||
include_role:
|
ansible.builtin.include_role:
|
||||||
name: "redhat_cop.controller_configuration.{{ item }}"
|
name: "redhat_cop.controller_configuration.{{ item }}"
|
||||||
loop: "{{ controller_components }}"
|
loop: "{{ controller_components }}"
|
||||||
when:
|
when:
|
||||||
@@ -65,6 +66,6 @@
|
|||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Print Message
|
- name: Print Message
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ user_message }}"
|
msg: "{{ user_message }}"
|
||||||
when: user_message is defined
|
when: user_message is defined
|
||||||
|
|||||||
Reference in New Issue
Block a user