Issue Updating provision_host_report.j2
@@ -3,9 +3,7 @@ HPC Cluster
Reachable Hosts:
{% if reachable_host_number | int > 0 %}
{% for host in groups['reachable_ssh'] %}
-{% if reachable_host_number == 1 %}
- inet={{ host }}, link/ether={{ ethernet_detail_reachable.stdout | replace(';','')}}
-{% elif reachable_host_number | int > 1 %}
+{% if reachable_host_number | int >= 1 %}
{% if ethernet_detail_reachable.results[loop.index|int - 1].stdout | length | int > 1 %}
inet={{ host }}, link/ether={{ ethernet_detail_reachable.results[loop.index|int - 1].stdout | replace(';','')}}
{% else %}
@@ -19,18 +17,14 @@ Total reachable hosts: {{ reachable_host_number }}
Unreachable Hosts:
{% if unreachable_ping_host_number | int > 0 %}
{% for host in groups['ungrouped'] %}
-{% if unreachable_ping_host_number == 1 %}
- inet={{ host }}, link/ether={{ ethernet_detail_unreachable_ping.stdout | replace(';','')}}
-{% elif unreachable_ping_host_number | int > 1 %}
+{% if unreachable_ping_host_number | int >= 1 %}
inet={{ host }}, link/ether={{ ethernet_detail_unreachable_ping.results[loop.index|int - 1].stdout | replace(';','')}}
{% endif %}
{% endfor %}
{% endif %}
{% if unreachable_ssh_host_number | int > 0 %}
{% for host in groups['unreachable_ssh'] %}
-{% if unreachable_ssh_host_number == 1 %}
- inet={{ host }}, link/ether={{ ethernet_detail_unreachable_ssh.stdout | replace(';','')}}
-{% elif unreachable_ssh_host_number | int > 1 %}
+{% if unreachable_ssh_host_number | int >= 1 %}
inet={{ host }}, link/ether={{ ethernet_detail_unreachable_ssh.results[loop.index|int - 1].stdout | replace(';','')}}
{% endif %}
{% endfor %}
