mirror of
https://gitea.0xace.cc/ansible-galaxy/network.git
synced 2025-07-20 14:53:08 +00:00
add network
This commit is contained in:
34
tasks/RedHat/network_scripts.yaml
Normal file
34
tasks/RedHat/network_scripts.yaml
Normal 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
|
Reference in New Issue
Block a user