feat ✨: Add new task to disable Wake-on-LAN and update existing task with mode parameter
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 to disable Wake-on-LAN functionality and enhances an existing task by adding a mode parameter, allowing for more flexible configuration options.
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
loop: "{{ en_interfaces }}"
|
||||
when: en_interfaces | length > 0
|
||||
|
||||
- name: Set Wake-on-LAN
|
||||
- name: "Set Wake-on-LAN to {{ wol_mode }}"
|
||||
ansible.builtin.command: "ethtool -s {{ item.0 }} wol {{ wol_mode }}"
|
||||
loop: "{{ en_interfaces | zip(wol_enabled.results, wol_supported.results) | list }}"
|
||||
loop_control:
|
||||
@@ -65,6 +65,15 @@
|
||||
- wol_mode not in item.1.stdout
|
||||
- wol_mode in item.2.stdout
|
||||
|
||||
- name: "Disable Wake-on-LAN"
|
||||
ansible.builtin.command: "ethtool -s {{ item.0 }} wol {{ wol_mode }}"
|
||||
loop: "{{ en_interfaces | zip(wol_enabled.results, wol_supported.results) | list }}"
|
||||
loop_control:
|
||||
label: "{{ item.0 }}"
|
||||
when:
|
||||
- wol_mode == 'd'
|
||||
- wol_mode not in item.1.stdout
|
||||
|
||||
|
||||
# # ============================================================
|
||||
# # Enable WOL immediately (only if needed)
|
||||
|
||||
Reference in New Issue
Block a user