From 1d4534f19ce9fe9579e1dffa742b57f6f2bc631b Mon Sep 17 00:00:00 2001 From: Jeltz Date: Mon, 5 Sep 2022 11:49:19 +0200 Subject: [PATCH] aruba: truncate long strings --- playbooks/aruba.yml | 5 ++++- roles/aruba/defaults/main.yml | 1 + roles/aruba/templates/config.j2 | 12 ++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/playbooks/aruba.yml b/playbooks/aruba.yml index 01984dc..59d3eaf 100755 --- a/playbooks/aruba.yml +++ b/playbooks/aruba.yml @@ -14,7 +14,10 @@ aruba__dns_servers: - 10.128.0.1 - 2a09:6840:128:0:1::1 - aruba__dns_domain_name: switch.infra.auro.re + aruba__dns_domain_names: + - switch.infra.auro.re + - infra.auro.re + - auro.re aruba__manager_password: "P@ssw0rd!" aruba__operator_password: "P@ssw0rd!" aruba__default_gateways: diff --git a/roles/aruba/defaults/main.yml b/roles/aruba/defaults/main.yml index 8533a55..408044a 100644 --- a/roles/aruba/defaults/main.yml +++ b/roles/aruba/defaults/main.yml @@ -5,6 +5,7 @@ aruba__interfaces: {} aruba__default_gateways: [] aruba__ssh_enabled: False aruba__rest_enabled: True +aruba__dns_domain_names: [] aruba__loop_protect_disable_timer: 30 aruba__loop_protect_tx_interval: 3 ... diff --git a/roles/aruba/templates/config.j2 b/roles/aruba/templates/config.j2 index db451cc..da146f0 100644 --- a/roles/aruba/templates/config.j2 +++ b/roles/aruba/templates/config.j2 @@ -1,6 +1,6 @@ {{ ansible_managed | comment(decoration="; ") }} -hostname {{ aruba__hostname | enquote }} +hostname {{ aruba__hostname | truncate(32) | enquote }} include-credentials @@ -20,9 +20,9 @@ time timezone 60 ip dns server-address priority {{ loop.index }} {{ addr | ipaddr }} {% endfor %} -{% if aruba__dns_domain_name is defined %} -ip dns domain-name {{ aruba__dns_domain_name | enquote }} -{% endif %} +{% for domain in aruba__dns_domain_names[:5] %} +ip dns domain-name {{ domain | enquote }} +{% endfor %} ; TODO {% if False %} @@ -98,7 +98,7 @@ ipv6 default-gateway {{ aruba__default_gateways | ipv6 | first }} {% for id, vlan in aruba__vlans.items() %} vlan {{ id | int }} {% if vlan.name is defined %} - name {{ vlan.name | enquote }} + name {{ vlan.name | truncate(32) | enquote }} {% endif %} {% set untagged = @@ -142,7 +142,7 @@ set tagged = {% for id, iface in aruba__interfaces.items() %} interface {{ id | int }} {% if iface.name is defined %} - name {{ iface.name | enquote }} + name {{ iface.name | truncate(32) | enquote }} {% endif %} {% if iface.enabled | default(True) %} enable