This repository has been archived on 2024-05-02. You can view files and clone it, but cannot push or open issues or pull requests.
omni-ansible/roles/networkd/tasks/main.yml

50 lines
1.1 KiB
YAML
Raw Normal View History

2019-11-23 19:30:39 +00:00
---
- 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