IPAM automation
( This has been tested with PHPIPAM version 1.2 on ManageIQ Dharma and Cloudforms 4.1 with the gem httparty 1.13 and ManageIQ Eureka and Cloudforms 4.2 with the gem httparty 1.14.)
You will need to install a gem for this one we need the httparty gem, for the version of ManageIQ ( Eureka ) Or Cloudforms 4.2 we need to install 1.14.
Go to the shell of the ManageIQ / CloudForms device as root and run
gem install httparty
This will take care of everything for you. If you are behind a firewall with no external access then download the gem from here
https://rubygems.org/gems/httparty/versions/0.14.0
The Download is on the right hand side of the page under the links section.
SCP it over to your appliance and run
gem install –local <path and gem file>
Next we want to get the Ruby script for PHPIPAM
You can grab it from here
https://github.com/jonlake5/miq-phpipam
Download the zip file
https://github.com/jonlake5/miq-phpipam/blob/master/PHPIPAM.zip
Dont unzip this go into ManageIQ/CloudForms and go to
Automate → Import/Export
Click on Choose file browse to the zip file and then click upload you will see phpipam-v1.2 will show up click the Toggle All/None and keep everything else default then click commit
Now we need to modify the variables for our environment go to
Automate → Explorer
You Will now see PHPIPAM ( Disabled) and this is at the top of the tree we want to drop this down underneath our own Datastore for reference mine is called test for this
Click on Datastore then configuration and select Edit Priority Order of Domains
Highlight the PHPIPAM and then use the arrows to drop it down underneath our own Domain ( Test in my case ) and save
Now back in the main Automate Explore Windows expand PHPIPAM / phpipam-v1.2/PHPIPAM
Now you will see in the main body window the Instances
Tick both of them
And under Configuration select Copy selected instances
Everything should be defaults to your Domain and keep it ticked for Copy to same path
And click copy
You should now see the copy in your datastore that only has the Instances inside of it.
Configuration and Edit the instances
and fill out the relevant information
NOTE THE URL IS REFERENCE TO AN API THE URL MUST END WITH A / “https://phpipam.example.com/api/”
Do the same for the ReleaseIPAddress.
Now we need to add this into our Provision and Retirement instances if you dont already have a copy of it expand ( CloudForms uses the same ManageIQ datastore for this )
ManageIQ / Infrastructure / VM / Provisioning / Statemachines / VMProvision_VM
and tick and copy the Provision VM From Template and Clone VM instances to your Datastore
Also copy the
ManageIQ / Infrastructure / VM / Retirement / StateMachines / VMRetirement /
Default and Unregister instances to your Datastore
Now Edit Each one and Modify the AcquireIPAddress Section for Provision instances to have
/phpipam-v1.2/PHPIPAM/AcquireIPAddress
And then for the Retirement Instances edit them both to have the ReleaseIPAddress section
/phpipam-v1.2/PHPIPAM/ReleaseIPAddress
That is it