55 lines
1.7 KiB
YAML
55 lines
1.7 KiB
YAML
---
|
|
# Configure globals section
|
|
- name: Configure globals section
|
|
when: network_globals is defined
|
|
ansible.builtin.include_tasks: globals.yml
|
|
|
|
# Configure swconfig vlan section
|
|
- name: Configure swconfig vlan section
|
|
ansible.builtin.include_tasks: swconfig.yml
|
|
when: network_swconfig is defined
|
|
loop: "{{ network_swconfig | default([]) }}"
|
|
|
|
# Configure device section
|
|
- name: Configure device section
|
|
ansible.builtin.include_tasks: device.yml
|
|
loop: "{{ network_devices | default([]) + network_devices_append | default([]) }}"
|
|
|
|
# Configure dsa switch vlan section
|
|
- name: Configure dsa switch vlan section
|
|
ansible.builtin.include_tasks: vlan_filtering.yml
|
|
when: network_bridge_vlan_filtering is defined
|
|
loop: "{{ network_bridge_vlan_filtering | default([]) }}"
|
|
|
|
# Configure interface section
|
|
- name: Configure interface section
|
|
ansible.builtin.include_tasks: interface.yml
|
|
loop: "{{ network_interfaces | default([]) }}"
|
|
|
|
# Configure rule section
|
|
- name: Configure rule section
|
|
ansible.builtin.include_tasks: rule.yml
|
|
loop: "{{ network_rules | default([]) }}"
|
|
|
|
# Configure route section
|
|
- name: Configure route section
|
|
ansible.builtin.include_tasks: route.yml
|
|
loop: "{{ network_routes | default([]) }}"
|
|
|
|
# Apply changes and reload network service
|
|
- name: Apply changes and reload network
|
|
uci:
|
|
command: commit
|
|
|
|
# Reload network service
|
|
- name: Reload network
|
|
nohup:
|
|
command: /etc/init.d/network restart
|
|
# Update device ip address
|
|
- name: Update device ip address
|
|
set_fact:
|
|
ansible_host: "{{ device_ip_address }}"
|
|
when: device_ip_address is defined
|
|
- name: Wait target connection to become reachable/usable
|
|
ansible.builtin.wait_for_connection:
|
|
timeout: 30 |