kayobe/ansible/physical-network.yml
Mark Goddard b9e1243d7d Add support for configuration of Juniper switches
Support for Juniper switches is added via the Ansible junos_* modules.
This affects the following command:

kayobe physical network configure
2017-08-07 12:08:41 +00:00

47 lines
1.6 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 }}"
- name: Ensure Juniper physical switches are configured
hosts: switches_of_type_junos
gather_facts: no
roles:
- role: ssh-known-host
- role: juniper-switch
juniper_switch_delegate_to: localhost
juniper_switch_type: "{{ switch_type }}"
juniper_switch_provider: "{{ switch_juniper_provider }}"
juniper_switch_config: "{{ switch_config }}"
juniper_switch_interface_config: "{{ switch_interface_config }}"