2022-09-05 07:53:23 +02:00
|
|
|
|
{{ ansible_managed | comment(decoration="; ") }}
|
|
|
|
|
|
2022-09-05 11:52:12 +02:00
|
|
|
|
hostname {{ aruba__hostname | hostname | truncate(32) | enquote }}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
|
|
|
|
|
include-credentials
|
|
|
|
|
|
|
|
|
|
{% if aruba__ntp_servers %}
|
|
|
|
|
timesync ntp
|
|
|
|
|
ntp unicast
|
2022-09-05 09:25:30 +02:00
|
|
|
|
{% for addr in aruba__ntp_servers %}
|
|
|
|
|
ntp server {{ addr | ipaddr }} iburst
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endfor %}
|
|
|
|
|
{% if aruba__timezone == "Europe/Paris" %}
|
|
|
|
|
time daylight-time-rule western-europe
|
|
|
|
|
time timezone 60
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2022-09-05 09:25:30 +02:00
|
|
|
|
{% for addr in aruba__dns_servers[:2] %}
|
|
|
|
|
ip dns server-address priority {{ loop.index }} {{ addr | ipaddr }}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endfor %}
|
|
|
|
|
|
2022-09-05 11:49:19 +02:00
|
|
|
|
{% for domain in aruba__dns_domain_names[:5] %}
|
|
|
|
|
ip dns domain-name {{ domain | enquote }}
|
|
|
|
|
{% endfor %}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
|
|
|
|
|
; TODO
|
|
|
|
|
{% if False %}
|
|
|
|
|
snmpv3 enable
|
|
|
|
|
snmpv3 only
|
|
|
|
|
snmpv3 user "re2o"
|
|
|
|
|
;snmpv3 group ManagerPriv user "re2o" sec-model ver3
|
|
|
|
|
;snmp-server community "public" Operator
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
no cdp run
|
|
|
|
|
lldp run
|
|
|
|
|
|
|
|
|
|
{%
|
|
|
|
|
set lldp_disabled =
|
|
|
|
|
aruba__interfaces.keys()
|
2022-09-05 09:17:53 +02:00
|
|
|
|
| difference(aruba__interfaces
|
|
|
|
|
| dict2items
|
|
|
|
|
| selectattr("value.lldp", "defined")
|
|
|
|
|
| selectattr("value.lldp", "==", True)
|
|
|
|
|
| map(attribute="key"))
|
2022-09-05 07:53:23 +02:00
|
|
|
|
| list
|
|
|
|
|
%}
|
|
|
|
|
{% if lldp_disabled %}
|
2022-09-05 09:10:42 +02:00
|
|
|
|
lldp admin-status {{ lldp_disabled | aruba_ints }} disable
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
password manager plaintext {{ aruba__manager_password | enquote }}
|
|
|
|
|
{% if aruba__operator_password is defined %}
|
|
|
|
|
password operator plaintext {{ aruba__operator_password | enquote }}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% if aruba__ssh_enabled %}
|
|
|
|
|
ip ssh
|
|
|
|
|
ip ssh ciphertype aes256–ctr
|
|
|
|
|
ip ssh kex ecdh-sha2-nistp521
|
|
|
|
|
ip ssh mac hmac-sha2-256
|
|
|
|
|
ip ssh filetransfer
|
|
|
|
|
{% else %}
|
|
|
|
|
no ip ssh
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
no telnet-server
|
2022-09-05 09:37:15 +02:00
|
|
|
|
|
|
|
|
|
{% if aruba__rest_enabled %}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
; FIXME: ssl
|
|
|
|
|
web-management plaintext
|
|
|
|
|
rest-interface
|
2022-09-05 09:37:15 +02:00
|
|
|
|
{% endif %}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
|
|
|
|
|
{%
|
|
|
|
|
set loop_protect =
|
|
|
|
|
aruba__interfaces
|
|
|
|
|
| dict2items
|
|
|
|
|
| selectattr("value.loop_protect", "defined")
|
|
|
|
|
| selectattr("value.loop_protect")
|
|
|
|
|
| map(attribute="key")
|
|
|
|
|
| list
|
|
|
|
|
%}
|
|
|
|
|
{% if loop_protect %}
|
|
|
|
|
loop-protect disable-timer {{ aruba__loop_protect_disable_timer | int }}
|
|
|
|
|
loop-protect transmit-interval {{ aruba__loop_protect_tx_interval | int }}
|
2022-09-05 09:10:42 +02:00
|
|
|
|
loop-protect {{ loop_protect | aruba_ints }}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% if aruba__default_gateways | ipv4 %}
|
|
|
|
|
ip default-gateway {{ aruba__default_gateways | ipv4 | first }}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% if aruba__default_gateways | ipv6 %}
|
|
|
|
|
ipv6 default-gateway {{ aruba__default_gateways | ipv6 | first }}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% for id, vlan in aruba__vlans.items() %}
|
|
|
|
|
vlan {{ id | int }}
|
|
|
|
|
{% if vlan.name is defined %}
|
2022-09-05 11:49:19 +02:00
|
|
|
|
name {{ vlan.name | truncate(32) | enquote }}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endif %}
|
|
|
|
|
{%
|
|
|
|
|
set untagged =
|
|
|
|
|
aruba__interfaces
|
|
|
|
|
| dict2items
|
|
|
|
|
| selectattr("value.untagged", "defined")
|
|
|
|
|
| selectattr("value.untagged", "==", id)
|
|
|
|
|
| map(attribute="key")
|
|
|
|
|
| list
|
|
|
|
|
%}
|
|
|
|
|
{% if untagged %}
|
2022-09-05 09:10:42 +02:00
|
|
|
|
untagged {{ untagged | aruba_ints }}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endif %}
|
|
|
|
|
{%
|
|
|
|
|
set tagged =
|
|
|
|
|
aruba__interfaces
|
|
|
|
|
| dict2items
|
|
|
|
|
| selectattr("value.tagged", "defined")
|
|
|
|
|
| selectattr("value.tagged", "contains", id)
|
|
|
|
|
| map(attribute="key")
|
|
|
|
|
| list
|
|
|
|
|
%}
|
|
|
|
|
{% if tagged %}
|
2022-09-05 09:10:42 +02:00
|
|
|
|
tagged {{ tagged | aruba_ints }}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endif %}
|
|
|
|
|
{% if vlan.addresses | default([]) %}
|
2022-09-05 09:25:30 +02:00
|
|
|
|
{% for addr in vlan.addresses | ipv4 %}
|
|
|
|
|
ip address {{ addr | ipaddr("address") }} {{ addr | ipaddr("netmask") }}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endfor %}
|
2022-09-05 09:25:30 +02:00
|
|
|
|
{% for addr in vlan.addresses | ipv6 %}
|
|
|
|
|
ipv6 address {{ addr | ipaddr("address") }} {{ addr | ipaddr("netmask") }}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endfor %}
|
|
|
|
|
{% else %}
|
|
|
|
|
no ip address
|
|
|
|
|
{% endif %}
|
|
|
|
|
no flow-control
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
{% for id, iface in aruba__interfaces.items() %}
|
|
|
|
|
interface {{ id | int }}
|
|
|
|
|
{% if iface.name is defined %}
|
2022-09-05 11:49:19 +02:00
|
|
|
|
name {{ iface.name | truncate(32) | enquote }}
|
2022-09-05 09:10:42 +02:00
|
|
|
|
{% endif %}
|
|
|
|
|
{% if iface.enabled | default(True) %}
|
|
|
|
|
enable
|
|
|
|
|
{% else %}
|
|
|
|
|
no enable
|
2022-09-05 10:18:43 +02:00
|
|
|
|
{% endif %}
|
|
|
|
|
{% if iface.speed is defined %}
|
|
|
|
|
speed {{ iface.speed | int | choices([10, 100, 1000]) }}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% if iface.duplex is defined %}
|
|
|
|
|
duplex {{ iface.duplex | choices(["full", "half", "auto"]) }}
|
2022-09-05 07:53:23 +02:00
|
|
|
|
{% endif %}
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
|
|
{% endfor %}
|