ansible-role-cmdb/templates/section_networking.txt.j2

49 lines
1.7 KiB
Text
Raw Normal View History

2023-06-19 15:12:18 +02:00
===== Networking =====
==== Uplink ====
2023-10-01 19:10:11 +02:00
* SSH-Port: {{ ansible_port | default('22')}}
2023-06-19 15:12:18 +02:00
{% if ansible_facts['default_ipv6']['address'] is defined %}
**IPv6:**
* Address: ''{{ ansible_facts['default_ipv6']['address'] }}''
* Prefix: ''{{ ansible_facts['default_ipv6']['prefix'] }}''
* Gateway: {% if ansible_facts['default_ipv6']['gateway'] is defined %}''{{ ansible_facts['default_ipv6']['gateway'] }}''{% else %}no gateway{% endif %}
* Interface: ''{{ ansible_facts['default_ipv6']['interface'] }}''
* MTU: ''{{ ansible_facts['default_ipv6']['mtu'] }}''
{% endif %}
{% if ansible_facts['default_ipv4']['address'] is defined %}
**IPv4:**
* Network type: {% if (ansible_facts['default_ipv4']['address'] | ansible.utils.ipaddr('public')) %}//public//{% else %}//private//{% endif %}
* Address: ''{{ ansible_facts['default_ipv4']['address'] }}''
* Gateway: {% if ansible_facts['default_ipv4']['gateway'] is defined %}''{{ ansible_facts['default_ipv4']['gateway'] }}''{% else %}no gateway{% endif %}
* Interface: ''{{ ansible_facts['default_ipv4']['interface'] }}''
* MTU: ''{{ ansible_facts['default_ipv4']['mtu'] }}''
{% endif %}
==== Other ====
**IPv6 addresses:**
{% for address in ansible_facts['all_ipv6_addresses'] %}
* ''{{ address }}'' {% if (address | ansible.utils.ipaddr('public')) %}//public//{% else %}//private//{% endif %}
{% endfor %}
**IPv4 addresses:**
{% for address in ansible_facts['all_ipv4_addresses'] %}
* ''{{ address }}'' {% if (address | ansible.utils.ipaddr('public')) %}//public//{% else %}//private//{% endif %}
{% endfor %}
**network interfaces:**
{% for interface in ansible_facts['interfaces'] %}
* ''{{ interface }}''
{% endfor %}