feat: add wol configuration

This commit is contained in:
vincent 2022-12-10 18:50:44 +01:00
parent dcac7dae39
commit cdef59b348
4 changed files with 22 additions and 0 deletions

View File

@ -42,3 +42,6 @@ system_ssh_custom_host: []
# - host:
# user:
# keyfile:
system_wol_enable: False
system_wol_mac: "{{ ansible_default_ipv4.macaddress }}"

View File

@ -42,5 +42,8 @@ provisioner:
debian:
user:
name: user
group_vars:
all:
system_wol_enable: True
verifier:
name: ansible

9
tasks/wol.yml Normal file
View File

@ -0,0 +1,9 @@
- name: Configure wol
ansible.builtin.template:
src: 50-wired.link
dest: /etc/systemd/network/
owner: root
group: root
mode: 0644
become: true
when: system_wol_enable is true

7
templates/50-wired.link Normal file
View File

@ -0,0 +1,7 @@
[Match]
MACAddress={{ system_wol_mac }}
[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent
WakeOnLan=magic