feat(server): update subnet discovery date/time

!9 closes #12
This commit is contained in:
2024-02-23 15:15:40 +09:30
parent 7df863416e
commit ee8d694716
2 changed files with 23 additions and 0 deletions

View File

@ -56,3 +56,8 @@ The Server componet has the following workflow:
- _if no results found, no further processing occurs_
1. Update the phpIPAM MariaDB/MySQL database directly
## phpIPAM Features
- **Last discovery time** This is displayed within the subnet interface next to the `Discover new hosts` fieled. Whenever a scan report is received by the server this filed is updated to reflect the last scan time.

View File

@ -26,6 +26,24 @@
loop_var: ipaddress
- name: Update Subnet Discovery Time
community.mysql.mysql_query:
login_host: "{{ nofusscomputing_phpipam_scan_server.mysql_host }}"
login_port: "{{ nofusscomputing_phpipam_scan_server.mysql_port | default(3306) | int }}"
login_user: "{{ nofusscomputing_phpipam_scan_server.mysql_user }}"
login_password: "{{ nofusscomputing_phpipam_scan_server.mysql_password }}"
login_db: 'phpipam'
query: |-
UPDATE
subnets
SET
lastDiscovery = '{{ scan_result.scan.subnet.results[0].lastSeen }}'
WHERE
subnet = '{{ inbound_data.scan.subnet | ip2ipam }}'
single_transaction: true
- name: Update IP Addresses
ansible.builtin.include_tasks:
file: tasks/server/ipaddress.yaml