2021-10-26 21:34:13 +00:00
|
|
|
---
|
2023-09-24 00:48:12 +00:00
|
|
|
- name: Configure network with network-scripts
|
|
|
|
when: network.network_scripts is defined
|
|
|
|
block:
|
|
|
|
- name: Install network scripts
|
|
|
|
package:
|
|
|
|
name: network-scripts
|
|
|
|
state: present
|
|
|
|
|
2021-10-27 14:24:05 +00:00
|
|
|
- name: Create routing table in rt_tables
|
|
|
|
template:
|
|
|
|
src: rt_tables.j2
|
|
|
|
dest: /etc/iproute2/rt_tables
|
|
|
|
|
|
|
|
- name: Configure interfaces and routes with network-scripts
|
2023-09-24 00:48:12 +00:00
|
|
|
vars:
|
|
|
|
iface: "{{ item }}"
|
|
|
|
include_tasks: network_scripts.yaml
|
2021-10-27 14:24:05 +00:00
|
|
|
loop: "{{ network.network_scripts.iface }}"
|
2021-10-26 21:34:13 +00:00
|
|
|
|
|
|
|
|
2023-09-24 00:48:12 +00:00
|
|
|
- name: Configure network with Network Manager
|
|
|
|
when: network.network_manager is defined
|
|
|
|
block:
|
2021-10-26 21:34:13 +00:00
|
|
|
- name: Install NetworkManager-dispatcher-routing-rules
|
|
|
|
package:
|
|
|
|
name:
|
|
|
|
- NetworkManager-dispatcher-routing-rules
|
|
|
|
state: present
|
2023-09-24 00:48:12 +00:00
|
|
|
when: ansible_distribution_major_version == '7'
|
2021-10-26 21:34:13 +00:00
|
|
|
|
|
|
|
- name: Configure interfaces and routes with nmcli
|
2023-09-24 00:48:12 +00:00
|
|
|
vars:
|
|
|
|
iface: "{{ item }}"
|
|
|
|
include_tasks: network_manager.yaml
|
2021-10-26 21:34:13 +00:00
|
|
|
loop: "{{ network.network_manager.iface }}"
|
|
|
|
|