Skip to content

Commit

Permalink
sap_maintain_etc_hosts: use the regex method also for assert
Browse files Browse the repository at this point in the history
Relates to sap-linuxlab#667.

Signed-off-by: Bernd Finger <[email protected]>
  • Loading branch information
berndfinger committed Feb 29, 2024
1 parent 0e9b7e5 commit 8b8748f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion roles/sap_maintain_etc_hosts/tasks/update_host_absent.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Verify that variable node_ip is in the correct format
ansible.builtin.assert:
that: thishost.node_ip is ansible.utils.ip
that: thishost.node_ip | regex_search(sap_maintain_etc_hosts_regexp_ipv4) or
thishost.node_ip | regex_search(sap_maintain_etc_hosts_regexp_ipv6)
msg: "Variable 'node_ip' is not an IP address. Please use the correct format"
when: thisnode.node_ip is defined

Expand Down

0 comments on commit 8b8748f

Please sign in to comment.