50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
|
---
|
||
|
- import_tasks: packages.yml
|
||
|
|
||
|
- name: Delete networkd config directory
|
||
|
become: true
|
||
|
file:
|
||
|
path: /etc/systemd/network
|
||
|
state: absent
|
||
|
|
||
|
- name: Create the networkd config directory
|
||
|
become: true
|
||
|
file:
|
||
|
path: /etc/systemd/network
|
||
|
state: directory
|
||
|
|
||
|
- name: Make network files
|
||
|
when: networking is defined
|
||
|
become: true
|
||
|
template:
|
||
|
src: network.j2
|
||
|
dest: "/etc/systemd/network/{{ item.key }}.network"
|
||
|
loop: "{{ networking | dict2items }}"
|
||
|
|
||
|
- name: Make netdev files
|
||
|
when: networking is defined
|
||
|
become: true
|
||
|
template:
|
||
|
src: netdev.j2
|
||
|
dest: "/etc/systemd/network/{{ item.key }}.netdev"
|
||
|
loop: "{{ networking | dict2items }}"
|
||
|
|
||
|
- import_tasks: services.yml
|
||
|
|
||
|
- name: Symlink so systemd-resolved uses /etc/resolv.conf
|
||
|
become: true
|
||
|
file:
|
||
|
dest: /etc/resolv.conf
|
||
|
src: /run/systemd/resolve/resolv.conf
|
||
|
state: link
|
||
|
force: true
|
||
|
setype: net_conf_t
|
||
|
|
||
|
- name: Symlink so /etc/resolv.conf uses systemd
|
||
|
become: true
|
||
|
file:
|
||
|
dest: /etc/systemd/system/multi-user.target.wants/systemd-resolved.service
|
||
|
src: /usr/lib/systemd/system/systemd-resolved.service
|
||
|
state: link
|
||
|
force: true
|