summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inventory/group_vars/chaos-at-home-switches/vars.yml2
-rw-r--r--inventory/group_vars/vmhost-ch-prometheus/vars.yml2
-rw-r--r--inventory/host_vars/ch-sw1.yml2
-rw-r--r--roles/chaos-at-home/fileserver/tasks/main.yml2
-rw-r--r--roles/dellos6/base/tasks/main.yml14
-rw-r--r--roles/dellos6/bootstrap/tasks/main.yml10
6 files changed, 16 insertions, 16 deletions
diff --git a/inventory/group_vars/chaos-at-home-switches/vars.yml b/inventory/group_vars/chaos-at-home-switches/vars.yml
index fb72c9b1..2b5bc625 100644
--- a/inventory/group_vars/chaos-at-home-switches/vars.yml
+++ b/inventory/group_vars/chaos-at-home-switches/vars.yml
@@ -5,8 +5,10 @@ switch_mgmt_interface: "Gi1/0/28"
switch_vlans: "{{ switch_vlans_yaml | from_yaml }}"
switch_vlans_yaml: |
{% for zone_name in network_zones.keys() %}
+ {% if 'vlan' in network_zones[zone_name] %}
- name: "{{ zone_name }}"
id: "{{ network_zones[zone_name].vlan }}"
+ {% endif %}
{% endfor %}
switch_interfaces: "{{ switch_interfaces_yaml | from_yaml }}"
diff --git a/inventory/group_vars/vmhost-ch-prometheus/vars.yml b/inventory/group_vars/vmhost-ch-prometheus/vars.yml
index 888c0bcf..ac5e3b6e 100644
--- a/inventory/group_vars/vmhost-ch-prometheus/vars.yml
+++ b/inventory/group_vars/vmhost-ch-prometheus/vars.yml
@@ -1,6 +1,6 @@
---
__vmhost_bridge_interface_zones__:
- bond0: "{{ network_zones | list | difference(['lan']) }}"
+ bond0: "{{ network_zones | dict2items | selectattr('value.vlan', 'defined') | map(attribute='key') | difference(['lan']) }}"
__vmhost_bridge_interface_zones_yaml__: |
{% for interface in (__vmhost_bridge_interface_zones__.keys() | sort) %}
diff --git a/inventory/host_vars/ch-sw1.yml b/inventory/host_vars/ch-sw1.yml
index ad7b6372..cf77edbf 100644
--- a/inventory/host_vars/ch-sw1.yml
+++ b/inventory/host_vars/ch-sw1.yml
@@ -22,7 +22,7 @@ switch_interfaces_yaml: |
description: "prometheus"
switchport_mode: general
tagged_only: yes
- allowed_vlans_tagged: {{ network_zones | list | difference(['lan']) | map('extract', network_zones) | map(attribute='vlan') | list }}
+ allowed_vlans_tagged: {{ network_zones | list | difference(['lan']) | map('extract', network_zones) | selectattr('vlan', 'defined') | map(attribute='vlan') | list }}
- spec: range Gi1/0/7-14
vlan: {{ network_zones.lan.vlan }}
diff --git a/roles/chaos-at-home/fileserver/tasks/main.yml b/roles/chaos-at-home/fileserver/tasks/main.yml
index 41a2975c..7c1c86be 100644
--- a/roles/chaos-at-home/fileserver/tasks/main.yml
+++ b/roles/chaos-at-home/fileserver/tasks/main.yml
@@ -51,7 +51,7 @@
- name: generate list of all export destinations
set_fact:
- filesearver_nfs_all_destinations: "{{ fileserver_nfs_default_destinations | map(attribute='dest') | list | union(fileserver_zfs_filesystems | selectattr('export_to', 'defined') | map(attribute='export_to') | flatten | map(attribute='dest') | list) | cidr_merge }}"
+ filesearver_nfs_all_destinations: "{{ fileserver_nfs_default_destinations | map(attribute='dest') | list | union(fileserver_zfs_filesystems | selectattr('export_to', 'defined') | map(attribute='export_to') | flatten | map(attribute='dest') | list) | ansible.utils.cidr_merge }}"
- name: export filesystems
blockinfile:
diff --git a/roles/dellos6/base/tasks/main.yml b/roles/dellos6/base/tasks/main.yml
index 58c31d74..72193448 100644
--- a/roles/dellos6/base/tasks/main.yml
+++ b/roles/dellos6/base/tasks/main.yml
@@ -4,8 +4,8 @@
when: dellos6_sntp is defined
dellos6_config:
lines:
- - "sntp server {{ dellos6_sntp.server }}"
- - sntp unicast client enable
+ - "sntp server {{ dellos6_sntp.server }}"
+ - sntp unicast client enable
notify: save configuration
## TODO: disable logging if dellos6_logging is not defined?
@@ -13,8 +13,8 @@
when: dellos6_logging is defined
dellos6_config:
lines:
- - "logging {{ dellos6_logging.server }}"
- - exit
+ - "logging {{ dellos6_logging.server }}"
+ - exit
notify: save configuration
## TODO: disable snmp if dellos6_snmp is not defined?
@@ -22,7 +22,7 @@
when: dellos6_snmp is defined
dellos6_config:
lines:
- - '{% if "location" in dellos6_snmp %}snmp-server location "{{ dellos6_snmp.location }}"{% else %}no snmp-server location{% endif %}'
- - '{% if "contact" in dellos6_snmp %}snmp-server contact "{{ dellos6_snmp.contact }}"{% else %}no snmp-server contact{% endif %}'
- - 'snmp-server community {{ dellos6_snmp.community }}'
+ - '{% if "location" in dellos6_snmp %}snmp-server location "{{ dellos6_snmp.location }}"{% else %}no snmp-server location{% endif %}'
+ - '{% if "contact" in dellos6_snmp %}snmp-server contact "{{ dellos6_snmp.contact }}"{% else %}no snmp-server contact{% endif %}'
+ - 'snmp-server community {{ dellos6_snmp.community }}'
notify: save configuration
diff --git a/roles/dellos6/bootstrap/tasks/main.yml b/roles/dellos6/bootstrap/tasks/main.yml
index d6442e8f..af3bbcf1 100644
--- a/roles/dellos6/bootstrap/tasks/main.yml
+++ b/roles/dellos6/bootstrap/tasks/main.yml
@@ -1,19 +1,17 @@
---
- name: only one ssh key for root?
- delegate_to: localhost
- when: (ssh_keys_root | length) > 1
- fail:
- msg: "users may have at the most one ssh-key"
+ assert:
+ that: (ssh_keys_root | length) > 1
+ fail_msg: "users may have at the most one ssh-key"
- name: generate initial configuration
- delegate_to: localhost
pause:
prompt: "\n## Please apply the following configuration using the serial console!!!\n\n{{ lookup('template', 'init.j2') }}\n\n## end .. press ENTER to continue!!!!!\n"
- name: get config facts from the switch
dellos6_facts:
gather_subset:
- - hardware
+ - hardware
register: switch_facts
- debug: