kayobe/ansible/physical-network.yml
Mark Goddard 65ed0da197 Separate physical configuration for discovery
After discovery Neutron needs to own the control of ports for the baremetal compute
nodes. We separate the interface configuration and add an --enable-discovery flag
to kayobe physical network configure
2017-04-03 12:10:47 +01:00

34 lines
1.2 KiB
YAML

---
# Switch configuration depends on the type of switch, so groups hosts by their
# switch type and apply tasks/roles to the relevant groups.
- name: Group hosts by their switch type
hosts: switches
gather_facts: no
vars:
# Set this variable to True to configure of network for hardware discovery.
physical_network_enable_discovery: False
tasks:
- name: Group hosts by their switch type
group_by:
key: "switches_of_type_{{ switch_type }}"
- name: Add discovery interface configuration when performing discovery
set_fact:
switch_interface_config: >
{{ switch_interface_config | combine(switch_interface_config_discovery) }}
when: "{{ physical_network_enable_discovery | bool }}"
- name: Ensure DellOS physical switches are configured
hosts: switches_of_type_dellos6:switches_of_type_dellos9
gather_facts: no
roles:
- role: ssh-known-host
- role: dell-switch
dell_switch_delegate_to: localhost
dell_switch_type: "{{ switch_type }}"
dell_switch_provider: "{{ switch_dellos_provider }}"
dell_switch_config: "{{ switch_config }}"
dell_switch_interface_config: "{{ switch_interface_config }}"