Files
ansible_proxmox_WOL/tasks/main.yml
Jose 9bef606607 feat : Enable Wake-on-LAN persistently
This commit introduces persistent Wake-on-LAN support for Proxmox VE via Ansible. It includes YAML configuration options for the interface, verification, and systemd service management, ensuring reliable functionality after Ansible role execution. The changes also address ignoring outputs and temporary files for a cleaner setup.
2025-12-14 20:46:32 +01:00

33 lines
709 B
YAML

---
- name: Install required packages
apt:
name: ethtool
state: present
update_cache: yes
- name: Create systemd service for Wake-on-LAN
template:
src: wol.service.j2
dest: /etc/systemd/system/wol.service
owner: root
group: root
mode: '0644'
notify:
- Reload systemd
- Enable and start WOL service
- name: Enable WOL immediately (without reboot)
command: ethtool -s {{ wol_interface }} wol {{ wol_mode }}
changed_when: false
- name: Verify Wake-on-LAN status
command: ethtool {{ wol_interface }}
register: wol_status
changed_when: false
when: wol_verify
- name: Show WOL status
debug:
msg: "{{ wol_status.stdout_lines }}"
when: wol_verify