refactor ♻️: Refactor regex patterns for better multiline matching and readability
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 10s
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 10s
Updated regex patterns to enhance their ability to handle multiline strings and improved overall code readability.
This commit is contained in:
@@ -59,20 +59,20 @@
|
||||
|
||||
- name: Extract Supports Wake-on value
|
||||
set_fact:
|
||||
supports_wake_on: "{{ wol_status.results | regex_search('Supports Wake-on:\\s*(\\S+)', '\\1') }}"
|
||||
supports_wake_on: "{{ wol_status.results | regex_search('(?m)^\\s*Supports Wake-on:\\s*(\\S+)', '\\1') }}"
|
||||
|
||||
- name: Show Supports Wake-on value
|
||||
debug:
|
||||
msg: "Wake-on is {{ supports_wake_on }}"
|
||||
msg: "Supports Wake-on is: {{ supports_wake_on }}"
|
||||
|
||||
|
||||
- name: Extract Wake-on value
|
||||
set_fact:
|
||||
wake_on: "{{ wol_status.results | regex_search('Wake-on:\\s*(\\S+)', '\\1') }}"
|
||||
wake_on: "{{ wol_status.results | regex_search('(?m)^\\s*Wake-on:\\s*(\\S+)', '\\1') }}"
|
||||
|
||||
- name: Show Wake-on value
|
||||
debug:
|
||||
msg: "Wake-on is {{ wake_on }}"
|
||||
msg: "Wake-on is: {{ wake_on }}"
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user