From d57ba159057b622c2ae61388734918e0079e95b7 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 19 Feb 2024 20:17:16 +0930 Subject: [PATCH] feat(agent): upload scan results to server !1 --- playbooks/tasks/scan_subnet.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/playbooks/tasks/scan_subnet.yaml b/playbooks/tasks/scan_subnet.yaml index bd3fe60..4c70421 100644 --- a/playbooks/tasks/scan_subnet.yaml +++ b/playbooks/tasks/scan_subnet.yaml @@ -45,3 +45,17 @@ - name: To JSON ansible.builtin.set_fact: subnet_scan_results: "{{ subnet_scan_results | from_yaml }}" + + +- name: Upload Scan Results + ansible.builtin.uri: + url: "{{ nfc_c_http_server }}:{{ nfc_c_http_port }}/" + method: POST + body_format: json + body: { + "code": "{{ scanagent_code }}", + "scan": { + "subnet": "{{ subnet.address }}", + "results": "{{ subnet_scan_results }}" + } + }