From b9d069c59a8318899de109d598ab04d8659690e7 Mon Sep 17 00:00:00 2001 From: staffadmin Date: Sun, 30 Mar 2025 20:46:35 +0200 Subject: [PATCH] test --- scan.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scan.yml b/scan.yml index f919f08..2360df0 100644 --- a/scan.yml +++ b/scan.yml @@ -20,7 +20,7 @@ # 163.172.0.0/24 # 163.172.80.0/28 target_network: 163.172.91.0/24 - target_port: "443" + target_port: 443 # 163.172.0.0/20 # 163.172.16.0/20 # 163.172.31.0/20 @@ -64,6 +64,7 @@ cmd: "masscan {{ target_network }} -p{{ target_port }}" become: true register: scan_output + # when: target_port is not list # pause - debug: @@ -117,9 +118,13 @@ insertbefore: BOF create: yes loop: "{{ cert.results }}" + loop_control: + index_var: my_idx delegate_to: localhost - run_once: true - when: item.invocation is defined + #run_once: true + when: + - item.invocation is defined + - cert.results[my_idx].invocation.module_args.host.split('.')[2] != cert.results[my_idx+1].invocation.module_args.host.split('.')[2] - ansible.builtin.lineinfile: path: "{{ playbook_dir }}/scan/https/{{ item.invocation.module_args.host.split('.')[0] }}/{{ item.invocation.module_args.host.split('.')[1] }}/{{ item.invocation.module_args.host.split('.')[2] }}.csv"