{% load datetime_formatting %} {% load number_utils %} {% load pygments_highlights %} {% load host_interface %}
Host facts: {{ host.name | truncatechars:150 }}
{% if not host.facts %} {% else %}
{% if host.facts.ansible_uptime_seconds or host.facts.ansible_distribution or host.facts.ansible_kernel or host.facts.ansible_python.version or host.facts.ansible_user_id or host.facts.ansible_user_shell or host.facts.ansible_date_time.tz or host.facts.ansible_virtualization_type or host.facts.ansible_selinux or host.facts.ansible_bios_version %}
System & Environment
{% if host.facts.ansible_date_time.tz and host.facts.ansible_date_time.time %}
Local Time
{{ host.facts.ansible_date_time.date }} {{ host.facts.ansible_date_time.time }} ({{ host.facts.ansible_date_time.tz }})
{% elif host.facts.ansible_date_time.tz %}
Timezone
{{ host.facts.ansible_date_time.tz }}
{% elif host.facts.ansible_date_time.time %}
Local Time
{{ host.facts.ansible_date_time.date }} {{ host.facts.ansible_date_time.time }}
{% endif %} {% if host.facts.ansible_uptime_seconds %}
Uptime
{{ host.facts.ansible_uptime_seconds|duration_from_seconds }}
{% endif %} {% if host.facts.ansible_loadavg %} {% with nproc=host.facts.ansible_processor_nproc|default:1 %}
Load Average
{% if host.facts.ansible_loadavg.1m %}
1m
{{ host.facts.ansible_loadavg.1m|floatformat:2 }}
{% endif %} {% if host.facts.ansible_loadavg.5m %}
5m
{{ host.facts.ansible_loadavg.5m|floatformat:2 }}
{% endif %} {% if host.facts.ansible_loadavg.15m %}
15m
{{ host.facts.ansible_loadavg.15m|floatformat:2 }}
{% endif %}
{% endwith %} {% endif %} {% if host.facts.ansible_distribution %}
OS
{{ host.facts.ansible_distribution }}{% if host.facts.ansible_distribution_version %} {{ host.facts.ansible_distribution_version }}{% endif %}
{% endif %} {% if host.facts.ansible_kernel %}
Kernel
{{ host.facts.ansible_kernel }}
{% endif %} {% if host.facts.ansible_python.version %}
Python
{{ host.facts.ansible_python.version.major }}.{{ host.facts.ansible_python.version.minor }}.{{ host.facts.ansible_python.version.micro }}
{% endif %} {% if host.facts.ansible_user_id %}
User
{{ host.facts.ansible_user_id }}
{% endif %} {% if host.facts.ansible_user_shell %}
Shell
{{ host.facts.ansible_user_shell }}
{% endif %} {% if host.facts.ansible_virtualization_type or host.facts.ansible_selinux or host.facts.ansible_bios_version %}
{% endif %} {% if host.facts.ansible_virtualization_type %}
Virtualization
{{ host.facts.ansible_virtualization_type }}{% if host.facts.ansible_virtualization_role %} ({{ host.facts.ansible_virtualization_role }}){% endif %}
{% endif %} {% if host.facts.ansible_selinux %}
SELinux
{{ host.facts.ansible_selinux.status|title }} {% if host.facts.ansible_selinux.mode %}({{ host.facts.ansible_selinux.mode }}){% endif %}
{% endif %} {% if host.facts.ansible_bios_version %}
BIOS
{{ host.facts.ansible_bios_version }}
{% endif %}
{% endif %} {% if host.facts.ansible_processor.2 or host.facts.ansible_processor_cores or host.facts.ansible_processor_nproc or host.facts.ansible_memory_mb.real or host.facts.ansible_memory_mb.swap or host.facts.ansible_mounts %}
Processor
{% if host.facts.ansible_processor.2 or host.facts.ansible_processor_cores or host.facts.ansible_processor_nproc %}
{% if host.facts.ansible_processor.2 %}
{{ host.facts.ansible_processor.2|truncatechars:60 }}
{% endif %}
{% if host.facts.ansible_processor_cores %}
Cores {{ host.facts.ansible_processor_cores }}
{% endif %} {% if host.facts.ansible_processor_nproc %}
Threads {{ host.facts.ansible_processor_nproc }}
{% endif %}
{% endif %} {% if host.facts.ansible_memory_mb.real or host.facts.ansible_memory_mb.swap %} {% if host.facts.ansible_memory_mb.real %}
Memory
RAM Usage
{{ host.facts.ansible_memory_mb.real.used|default:0 }} MB / {{ host.facts.ansible_memory_mb.real.total|default:0 }} MB
{% if host.facts.ansible_memory_mb.real.used and host.facts.ansible_memory_mb.real.total %} {% with ram_pct=host.facts.ansible_memory_mb.real.used|percentage:host.facts.ansible_memory_mb.real.total %}
{{ ram_pct|floatformat:1 }}% used
{% endwith %} {% endif %}
{% if host.facts.ansible_memory_mb.real.used and host.facts.ansible_memory_mb.real.total %} {% with ram_pct=host.facts.ansible_memory_mb.real.used|percentage:host.facts.ansible_memory_mb.real.total %}
{% endwith %} {% endif %}
{% endif %} {% if host.facts.ansible_memory_mb.swap and host.facts.ansible_memory_mb.swap.total > 0 %}
Swap Usage
{{ host.facts.ansible_memory_mb.swap.used|default:0 }} MB / {{ host.facts.ansible_memory_mb.swap.total|default:0 }} MB
{% if host.facts.ansible_memory_mb.swap.used and host.facts.ansible_memory_mb.swap.total %} {% with swap_pct=host.facts.ansible_memory_mb.swap.used|percentage:host.facts.ansible_memory_mb.swap.total %}
{{ swap_pct|floatformat:1 }}% used
{% endwith %} {% endif %}
{% if host.facts.ansible_memory_mb.swap.used and host.facts.ansible_memory_mb.swap.total %} {% with swap_pct=host.facts.ansible_memory_mb.swap.used|percentage:host.facts.ansible_memory_mb.swap.total %}
{% endwith %} {% endif %}
{% endif %} {% endif %} {% if host.facts.ansible_mounts %}
Storage
{% for mount in host.facts.ansible_mounts %} {% if mount.size_total > 0 %}
{{ mount.mount }}
{{ mount.device }} ({{ mount.fstype }})
{% with used=mount.size_total|subtract:mount.size_available %} {% with pct=used|percentage:mount.size_total %}
{{ pct|floatformat:1 }}% used
{% endwith %} {% endwith %}
{{ mount.size_available|filesizeformat }} free
{% with used=mount.size_total|subtract:mount.size_available %} {% with pct=used|percentage:mount.size_total %}
{% endwith %} {% endwith %}
{% endif %} {% endfor %} {% endif %}
{% endif %} {% if host.facts.ansible_default_ipv4 or host.facts.ansible_default_ipv6 or host.facts.ansible_hostname or host.facts.ansible_dns or host.facts.ansible_interfaces %}
Network
{% if host.facts.ansible_hostname %}
Hostname
{{ host.facts.ansible_hostname }}
{% endif %} {% if host.facts.ansible_fqdn %}
FQDN
{{ host.facts.ansible_fqdn }}
{% endif %} {% if host.facts.ansible_dns.nameservers %}
DNS
{% for nameserver in host.facts.ansible_dns.nameservers %}
{{ nameserver }}
{% endfor %}
{% endif %} {% if host.facts.ansible_interfaces or host.facts.ansible_default_ipv4.interface or host.facts.ansible_default_ipv6.interface %}
Network Interfaces
{% if host.facts.ansible_default_ipv4.interface %}
{{ host.facts.ansible_default_ipv4.interface }} Primary
UP
{% if host.facts.ansible_default_ipv4.address %}
IPv4: {{ host.facts.ansible_default_ipv4.address }}{% if host.facts.ansible_default_ipv4.netmask %}/{{ host.facts.ansible_default_ipv4.netmask }}{% endif %}
{% endif %} {% if host.facts.ansible_default_ipv4.macaddress %}
MAC: {{ host.facts.ansible_default_ipv4.macaddress }}
{% endif %} {% if host.facts.ansible_default_ipv4.gateway %}
Gateway: {{ host.facts.ansible_default_ipv4.gateway }}
{% endif %}
{% endif %} {% if host.facts.ansible_default_ipv6.interface and host.facts.ansible_default_ipv6.interface != host.facts.ansible_default_ipv4.interface %}
{{ host.facts.ansible_default_ipv6.interface }} IPv6 Primary
UP
{% if host.facts.ansible_default_ipv6.address %}
IPv6: {{ host.facts.ansible_default_ipv6.address }}{% if host.facts.ansible_default_ipv6.prefix %}/{{ host.facts.ansible_default_ipv6.prefix }}{% endif %}
{% endif %} {% if host.facts.ansible_default_ipv6.macaddress %}
MAC: {{ host.facts.ansible_default_ipv6.macaddress }}
{% endif %}
{% endif %} {% if host.facts.ansible_interfaces %}
{% for interface in host.facts.ansible_interfaces %} {% if interface != host.facts.ansible_default_ipv4.interface and interface != host.facts.ansible_default_ipv6.interface %} {% with interface_data=host.facts|host_interface:interface %} {% if interface_data %}
{{ interface }} {% if 'bridge' in interface or 'br' in interface %} Bridge {% elif 'veth' in interface or 'tun' in interface or 'tap' in interface %} Virtual {% elif 'lo' == interface %} Loopback {% else %} Physical {% endif %}
{% if interface_data.active %}UP{% else %}DOWN{% endif %}
{% if interface_data.active %}
{% if interface_data.ipv4 %}
IPv4: {{ interface_data.ipv4.address }}{% if interface_data.ipv4.netmask %}/{{ interface_data.ipv4.netmask }}{% endif %}
{% endif %} {% if interface_data.ipv6 %} {% for ipv6 in interface_data.ipv6 %}
IPv6: {{ ipv6.address }}{% if ipv6.prefix %}/{{ ipv6.prefix }}{% endif %}
{% endfor %} {% endif %} {% if interface_data.macaddress %}
MAC: {{ interface_data.macaddress }}
{% endif %}
{% endif %}
{% endif %} {% endwith %} {% endif %} {% endfor %}
{% if host.facts.ansible_interfaces|length > 2 %} {% endif %} {% endif %}
{% endif %}
{% endif %}
All Host Facts
{% for fact, value in host.facts.items %} {% endfor %}
Fact Value
{{ fact }} {{ value | format_data | safe }}
{% endif %}