fix: rename files to .yaml
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 16s
Lint Markdown files / markdown-lint (push) Successful in 9s

This commit is contained in:
2025-11-23 16:17:00 +01:00
parent 2746306ca6
commit 6ea4a99156
7 changed files with 1 additions and 1 deletions

89
tasks/main.yaml Normal file
View File

@@ -0,0 +1,89 @@
---
- name: "Include OS-specific variables"
ansible.builtin.include_vars: "{{ ansible_facts['os_family'] }}.yaml"
- name: "Remove existing systemd-networkd configuration"
ansible.builtin.file:
path: "/etc/systemd/network"
state: absent
- name: "Create systemd-networkd directory"
ansible.builtin.file:
path: "/etc/systemd/network"
owner: root
group: root
mode: "0755"
state: directory
- name: Create systemd.netdev files
block:
- name: Create systemd.netdev files
ansible.builtin.template:
src: systemd.netdev.j2
dest: "/etc/systemd/network/{{ item.filename }}"
owner: "{{ systemd_networkd_unix_user }}"
group: "{{ systemd_networkd_unix_user }}"
mode: "0644"
when:
item.netdev_options is defined and
(item.netdev_options | selectattr('key', 'equalto', 'Kind') | map(attribute='value') | first) != 'wireguard'
with_items: "{{ systemd_networkd_netdev }}"
- name: Create sensitive systemd.netdev files
ansible.builtin.template:
src: systemd.netdev.j2
dest: "/etc/systemd/network/{{ item.filename }}"
owner: "{{ systemd_networkd_unix_user }}"
group: "{{ systemd_networkd_unix_user }}"
mode: "0600"
when: item.netdev_options is defined and
(item.netdev_options | selectattr('key', 'equalto', 'Kind') | map(attribute='value') | first) == 'wireguard'
with_items: "{{ systemd_networkd_netdev }}"
no_log: true
notify: Restart networkd
- name: Create systemd.networkd files
ansible.builtin.template:
src: systemd.network.j2
dest: "/etc/systemd/network/{{ item.filename }}"
owner: "{{ systemd_networkd_unix_user }}"
group: "{{ systemd_networkd_unix_user }}"
mode: "0644"
with_items: "{{ systemd_networkd_network }}"
notify: Restart networkd
- name: Create symlink to use systemd-resolved's stub-listener
ansible.builtin.file:
src: /run/systemd/resolve/stub-resolv.conf
dest: /etc/resolv.conf
state: link
force: true
follow: false
owner: root
group: root
- name: Start and enable systemd-networkd
ansible.builtin.systemd:
name: systemd-networkd
state: started
enabled: true
daemon_reload: true
- name: Start and enable systemd-resolved
ansible.builtin.systemd:
name: systemd-resolved
state: started
enabled: true
daemon_reload: true
- name: Set system timezone
community.general.timezone:
name: "{{ systemd_timesyncd_timezone }}"
- name: Start and enable systemd-timesyncd
ansible.builtin.systemd:
name: systemd-timesyncd
state: started
enabled: true
daemon_reload: true