mirror of
https://gitea.0xace.cc/ansible-galaxy/network.git
synced 2024-11-28 16:16:40 +00:00
35 lines
921 B
YAML
35 lines
921 B
YAML
|
---
|
||
|
- 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
|