fix: Don't process results if scan report is empty

!1
This commit is contained in:
2024-02-21 01:48:43 +09:30
parent c06a278ac3
commit 2b9fab6651
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@
ansible.builtin.set_fact:
subnet_scan_results: |-
[
{% for scanned_host in ((nmap_scan.stdout | ansible.utils.from_xml) | from_yaml).nmaprun.host %}
{% for scanned_host in ((nmap_scan.stdout | ansible.utils.from_xml) | from_yaml).nmaprun.host | default([]) %}
{% if
scanned_host.address[0]['@addrtype'] | default('') == 'ipv4'
or