feat ✨: Add task to install wakeonlan and send WOL packets
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 9s
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 9s
This commit introduces a new feature that includes adding a task to install the `wakeonlan` package and sending Wake-on-LAN (WOL) packets. This allows for remote control of devices by waking them up from a powered-off state.
This commit is contained in:
@@ -4,7 +4,9 @@
|
|||||||
# ============================================================
|
# ============================================================
|
||||||
- name: Install required packages
|
- name: Install required packages
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: ethtool
|
name:
|
||||||
|
- ethtool
|
||||||
|
- wakeonlan
|
||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
|
||||||
@@ -128,6 +130,10 @@
|
|||||||
ansible.builtin.pause:
|
ansible.builtin.pause:
|
||||||
seconds: 2
|
seconds: 2
|
||||||
|
|
||||||
|
- name: Send WOL packet via shell
|
||||||
|
ansible.builtin.shell: wakeonlan {{ wol_mac_addresses[0] }}
|
||||||
|
delegate_to: localhost
|
||||||
|
|
||||||
- name: Send Wake-on-LAN packet from localhost
|
- name: Send Wake-on-LAN packet from localhost
|
||||||
community.general.wakeonlan:
|
community.general.wakeonlan:
|
||||||
mac: "{{ wol_mac_addresses[0] }}"
|
mac: "{{ wol_mac_addresses[0] }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user