summaryrefslogtreecommitdiff
path: root/inventory
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-06-22 02:52:11 +0200
committerChristian Pointner <equinox@spreadspace.org>2019-06-22 02:52:11 +0200
commitea8d404676aaae68856ae82f0b2f01e230c39289 (patch)
tree33c1d443940b9f534bbdfec84d43a4d9893271de /inventory
parentdellos6: fix idempotence (diff)
dellos: basic vlan management
Diffstat (limited to 'inventory')
-rw-r--r--inventory/group_vars/chaos_at_home_switches/main.yml6
-rw-r--r--inventory/group_vars/dellos6/main.yml17
2 files changed, 17 insertions, 6 deletions
diff --git a/inventory/group_vars/chaos_at_home_switches/main.yml b/inventory/group_vars/chaos_at_home_switches/main.yml
index 676f87d8..df166186 100644
--- a/inventory/group_vars/chaos_at_home_switches/main.yml
+++ b/inventory/group_vars/chaos_at_home_switches/main.yml
@@ -1,3 +1,5 @@
---
-network_mgmt_zone: "{{ network_zones.mgmt }}"
-network_mgmt_interface: "Gi1/0/28"
+switch_mgmt_zone: "{{ network_zones.mgmt }}"
+switch_mgmt_interface: "Gi1/0/28"
+
+switch_network_zones: "{{ network_zones }}"
diff --git a/inventory/group_vars/dellos6/main.yml b/inventory/group_vars/dellos6/main.yml
index d3f2a80b..7bf53699 100644
--- a/inventory/group_vars/dellos6/main.yml
+++ b/inventory/group_vars/dellos6/main.yml
@@ -5,7 +5,16 @@ ansible_become: yes
ansible_become_method: enable
ansible_become_password: "{{ vault_ansible_become_password }}"
-dellos6_mgmt_vlan: "{{ network_mgmt_zone.vlan }}"
-dellos6_mgmt_ipaddr: "{{ network_mgmt_zone.prefix | ipaddr(network_mgmt_zone.offsets[inventory_hostname]) | ipaddr('address') }}"
-dellos6_mgmt_netmask: "{{ network_mgmt_zone.prefix | ipaddr('netmask') }}"
-dellos6_mgmt_interface: "{{ network_mgmt_interface | default('') }}"
+
+dellos6_mgmt_vlan: "{{ switch_mgmt_zone.vlan }}"
+dellos6_mgmt_ipaddr: "{{ switch_mgmt_zone.prefix | ipaddr(switch_mgmt_zone.offsets[inventory_hostname]) | ipaddr('address') }}"
+dellos6_mgmt_netmask: "{{ switch_mgmt_zone.prefix | ipaddr('netmask') }}"
+dellos6_mgmt_interface: "{{ switch_mgmt_interface | default('') }}"
+
+
+dellos6_vlans: "{{ dellos6_vlans_yaml | from_yaml }}"
+dellos6_vlans_yaml: |
+ {% for zone_name in switch_network_zones.keys() %}
+ - name: "{{ zone_name }}"
+ id: "{{ switch_network_zones[zone_name].vlan }}"
+ {% endfor %}