This commit is contained in:
ace
2023-09-24 03:48:12 +03:00
parent 8ba560a810
commit 8aa06f4399
8 changed files with 136 additions and 39 deletions

37
tasks/RedHat/main.yaml Normal file
View File

@ -0,0 +1,37 @@
---
- name: Configure network with network-scripts
when: network.network_scripts is defined
block:
- name: Install network scripts
package:
name: network-scripts
state: present
- 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
vars:
iface: "{{ item }}"
include_tasks: network_scripts.yaml
loop: "{{ network.network_scripts.iface }}"
- name: Configure network with Network Manager
when: network.network_manager is defined
block:
- name: Install NetworkManager-dispatcher-routing-rules
package:
name:
- NetworkManager-dispatcher-routing-rules
state: present
when: ansible_distribution_major_version == '7'
- name: Configure interfaces and routes with nmcli
vars:
iface: "{{ item }}"
include_tasks: network_manager.yaml
loop: "{{ network.network_manager.iface }}"