Debug and fix networkd role to work with cent8
This commit is contained in:
parent
8f839a4944
commit
b3f9e8fc80
@ -26,8 +26,8 @@
|
|||||||
become: true
|
become: true
|
||||||
template:
|
template:
|
||||||
src: netdev.j2
|
src: netdev.j2
|
||||||
dest: "/etc/systemd/network/{{ item.key }}.netdev"
|
dest: "/etc/systemd/network/{{ item.0.key + '.' + item.1 }}.netdev"
|
||||||
loop: "{{ networking | dict2items }}"
|
loop: "{{ networking | dict2items | subelements('value.vlans', true) }}"
|
||||||
|
|
||||||
- import_tasks: services.yml
|
- import_tasks: services.yml
|
||||||
|
|
||||||
|
@ -1,8 +1,34 @@
|
|||||||
---
|
---
|
||||||
- name: Install systemd-networkd
|
- name: Install networkd on Fedora
|
||||||
|
when: ansible_distribution == "Fedora"
|
||||||
become: true
|
become: true
|
||||||
dnf:
|
dnf:
|
||||||
state: latest
|
state: latest
|
||||||
name:
|
name:
|
||||||
- systemd-resolved
|
- systemd-resolved
|
||||||
- systemd-networkd
|
- systemd-networkd
|
||||||
|
|
||||||
|
- name: Install networkd on CentOS 7
|
||||||
|
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
|
||||||
|
become: true
|
||||||
|
yum:
|
||||||
|
state: latest
|
||||||
|
name:
|
||||||
|
- systemd-resolved
|
||||||
|
- systemd-networkd
|
||||||
|
|
||||||
|
- name: Install networkd on CentOS 8
|
||||||
|
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "8"
|
||||||
|
become: true
|
||||||
|
block:
|
||||||
|
- name: Install this super-legitimate and definitely vetted COPR repo
|
||||||
|
shell:
|
||||||
|
creates: /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:fschwarz:systemd-networkd.repo
|
||||||
|
cmd: dnf copr enable fschwarz/systemd-networkd
|
||||||
|
warn: false
|
||||||
|
- name: Install networkd
|
||||||
|
dnf:
|
||||||
|
state: latest
|
||||||
|
name:
|
||||||
|
# This now comes from aforementioned very good COPR repo
|
||||||
|
- systemd-networkd
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
enabled: false
|
enabled: false
|
||||||
loop:
|
loop:
|
||||||
- network
|
|
||||||
- NetworkManager
|
- NetworkManager
|
||||||
- NetworkManager-wait-online
|
- NetworkManager-wait-online
|
||||||
|
|
||||||
@ -26,7 +25,6 @@
|
|||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
loop:
|
loop:
|
||||||
- network
|
|
||||||
- NetworkManager
|
- NetworkManager
|
||||||
- NetworkManager-wait-online
|
- NetworkManager-wait-online
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
# ANSIBLE MANAGED FILE - DO NOT EDIT
|
# ANSIBLE MANAGED FILE - DO NOT EDIT
|
||||||
[NetDev]
|
[NetDev]
|
||||||
Name={{ item.key }}
|
Name={{ item.0.key }}
|
||||||
Kind=vlan
|
Kind=vlan
|
||||||
{% if item.value['kind'] == 'vlan' %}
|
|
||||||
|
|
||||||
[VLAN]
|
[VLAN]
|
||||||
Id={{ item.value['vlan'] }}
|
Id={{ item.1 }}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
Reference in New Issue
Block a user