IPAM Integration with External IPAM provider phpIPAM
This Feature / PR is a Foreman patch to support of the use of External IPAM, with opensource IPAM provider phpIPAM(https://phpipam.net).
The primary use case is to provide the next available IPv4 address from phpIPAM, for a given phpIPAM subnet.
The functionality that Foreman will use for External IPAM is encompassed in the below plugins(which are both new).
The `foreman_ipam` plugin provides a very basic dashboard to display sections and subnets from phpIPAM, and the `smart_proxy_ipam` plugin communicates with the phpIPAM API.
Features and functionality
- Simple IPAM Dashboard page(Infrastructure => IPAM Dashboard) to view sections and subnets for phpIPAM. More features will be added here based on internal user feedback and from the community.
- When creating a phpIPAM subnet(IPAM type = External IPAM) in Foreman, subnet/mask must exist in phpIPAM, or error will be thrown
- When creating a new host in Foreman, auto suggested IP's from phpIPAM will be persisted back to phpIPAM on Host submit.
- When updating the IP address on a NIC that uses a phpIPAM subnet, the old IP will be deleted from phpIPAM, and new one will be added.
- Deleting a host in Foreman will delete all NIC ip's that used a phpIPAM subnet
- Deleting a NIC from a host will also delete the IP from phpIPAM
- Deleting a subnet in Foreman will NOT delete the associated subnet in phpIPAM. This could easily be added later if it makes sense to the community, however initial thoughts are to not delete it.
NOTE: When creating a host in Foreman and adding multiple nics/interfaces, the same IP will be suggested from phpIPAM since it is not actually reserved in phpIPAM until you submit the host. The workaround for multiple nics is to use the suggested ip for the first interface(e.g. 10.0.0.1), then manually increment the IP for the second interface(e.g. 10.0.0.2). Errors will be thrown however if IP's are already taken.