@ -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.
|
||||
|
@ -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 = '{{ inbound_data.scan.results[0].lastSeen }}'
|
||||
WHERE
|
||||
subnet = '{{ (inbound_data.scan.subnet | split('/'))[0] | ip2ipam }}'
|
||||
single_transaction: true
|
||||
|
||||
|
||||
- name: Update IP Addresses
|
||||
ansible.builtin.include_tasks:
|
||||
file: tasks/server/ipaddress.yaml
|
||||
|
Reference in New Issue
Block a user