refactor ♻️: Refactor task names and conditions for better clarity and functionality
This refactoring improves the readability and logic of task management by renaming variables and simplifying conditional statements.
This commit is contained in:
@@ -17,16 +17,16 @@
|
|||||||
- network
|
- network
|
||||||
when: ansible_facts.interfaces is not defined
|
when: ansible_facts.interfaces is not defined
|
||||||
|
|
||||||
- name: Display WOL status per interface
|
- name: Display interfaces
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: >
|
msg: >
|
||||||
{{ ansible_facts.interfaces }}
|
{{ ansible_facts.interfaces }}
|
||||||
|
|
||||||
- name: Get interfaces starting with "en"
|
- name: Get interfaces starting with "en" or "eth"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
en_interfaces: "{{ ansible_facts.interfaces | select('match', '^eth|^ens|^enp') | unique | list }}"
|
en_interfaces: "{{ ansible_facts.interfaces | select('match', '^eth|^ens|^enp') | unique | list }}"
|
||||||
|
|
||||||
- name: Display WOL interface
|
- name: Display selected interfaces
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: >
|
msg: >
|
||||||
{{ en_interfaces }}
|
{{ en_interfaces }}
|
||||||
|
|||||||
Reference in New Issue
Block a user