add network

This commit is contained in:
ace
2021-10-27 00:34:13 +03:00
commit 3ef3e332ab
14 changed files with 248 additions and 0 deletions

View File

@ -0,0 +1,34 @@
---
- block:
- name: Create interfaces config files
template:
src: "ifcfg-{{ item.type | default('ethernet') }}.j2"
dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.name }}"
notify:
- Up interface
loop: "{{ network.network_scripts.iface }}"
- name: Create routing table in rt_tables
template:
src: rt_tables.j2
dest: /etc/iproute2/rt_tables
notify:
- Up interface
- name: Create routing rules for interfaces
template:
src: rule.j2
dest: "/etc/sysconfig/network-scripts/rule-{{ item.name }}"
notify:
- Up interface
loop: "{{ network.network_scripts.iface }}"
- name: Create routes for interfaces
template:
src: route.j2
dest: "/etc/sysconfig/network-scripts/route-{{ item.name }}"
notify:
- Up interface
loop: "{{ network.network_scripts.iface }}"
when: network.network_scripts is defined