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/tasks/networkd/configure.yml

25 lines
711 B
YAML
Raw Normal View History

2019-11-23 19:30:39 +00:00
---
- name: Configure networking via systemd
2019-11-23 19:30:39 +00:00
become: true
when: omni_networking is defined
block:
- name: Create the networkd config directory
file:
path: /etc/systemd/network
state: directory
2020-03-21 17:14:42 +00:00
mode: 0755
2019-11-23 19:30:39 +00:00
- name: Make network files
template:
src: networkd/network.j2
dest: "/etc/systemd/network/{{ item.key }}.network"
2020-03-21 17:14:42 +00:00
mode: 0644
loop: "{{ omni_networking | dict2items }}"
2019-11-23 19:30:39 +00:00
- name: Make netdev files
template:
src: networkd/netdev.j2
dest: "/etc/systemd/network/{{ item.0.key + '.' + item.1 }}.netdev"
2020-03-21 17:14:42 +00:00
mode: 0644
loop: "{{ omni_networking | dict2items | subelements('value.vlans', true) }}"