mirror of
https://gitea.0xace.cc/ansible-galaxy/network.git
synced 2025-06-29 02:53:07 +00:00
update
This commit is contained in:
@ -1,22 +0,0 @@
|
||||
---
|
||||
- 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
|
||||
include: network_scripts.yaml iface={{ item }}
|
||||
loop: "{{ network.network_scripts.iface }}"
|
||||
|
||||
when: network.network_scripts is defined
|
||||
|
||||
- name: Configure interfaces and routes with nmcli
|
||||
include: network_manager.yaml iface={{ item }}
|
||||
when: network.network_manager is defined
|
||||
loop: "{{ network.network_manager.iface }}"
|
@ -1,27 +1,37 @@
|
||||
---
|
||||
- block:
|
||||
- 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
|
||||
include: network_scripts.yaml iface={{ item }}
|
||||
vars:
|
||||
iface: "{{ item }}"
|
||||
include_tasks: network_scripts.yaml
|
||||
loop: "{{ network.network_scripts.iface }}"
|
||||
|
||||
when: network.network_scripts is defined
|
||||
|
||||
- block:
|
||||
- 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
|
||||
include: network_manager.yaml iface={{ item }}
|
||||
vars:
|
||||
iface: "{{ item }}"
|
||||
include_tasks: network_manager.yaml
|
||||
loop: "{{ network.network_manager.iface }}"
|
||||
|
||||
when: network.network_manager is defined
|
||||
|
||||
|
@ -25,12 +25,12 @@
|
||||
when: configure_interface.changed
|
||||
|
||||
- name: "{{ iface.conn_name }} | Get existing ipv4 routes"
|
||||
shell: nmcli -g ipv4.routes connection show {{ iface.conn_name }}
|
||||
shell: nmcli -g ipv4.routes connection show "{{ iface.conn_name }}"
|
||||
register: existing_routes4_res
|
||||
changed_when: False
|
||||
|
||||
- name: "{{ iface.conn_name }} | Get existing ipv6 routes"
|
||||
shell: nmcli -g ipv6.routes connection show {{ iface.conn_name }}
|
||||
shell: nmcli -g ipv6.routes connection show "{{ iface.conn_name }}"
|
||||
register: existing_routes6_res
|
||||
changed_when: False
|
||||
|
||||
|
Reference in New Issue
Block a user