feat: add wol configuration
This commit is contained in:
parent
dcac7dae39
commit
cdef59b348
@ -42,3 +42,6 @@ system_ssh_custom_host: []
|
|||||||
# - host:
|
# - host:
|
||||||
# user:
|
# user:
|
||||||
# keyfile:
|
# keyfile:
|
||||||
|
|
||||||
|
system_wol_enable: False
|
||||||
|
system_wol_mac: "{{ ansible_default_ipv4.macaddress }}"
|
||||||
|
@ -42,5 +42,8 @@ provisioner:
|
|||||||
debian:
|
debian:
|
||||||
user:
|
user:
|
||||||
name: user
|
name: user
|
||||||
|
group_vars:
|
||||||
|
all:
|
||||||
|
system_wol_enable: True
|
||||||
verifier:
|
verifier:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
9
tasks/wol.yml
Normal file
9
tasks/wol.yml
Normal 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
7
templates/50-wired.link
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[Match]
|
||||||
|
MACAddress={{ system_wol_mac }}
|
||||||
|
|
||||||
|
[Link]
|
||||||
|
NamePolicy=kernel database onboard slot path
|
||||||
|
MACAddressPolicy=persistent
|
||||||
|
WakeOnLan=magic
|
Loading…
Reference in New Issue
Block a user