This collection provides modules to manage entities in a phpIPAM. This is neither a collection of roles nor playbooks. It provides modules to write your own roles and/or playbooks.
We get a lot of inspiration from foreman-ansible-modules for our modules.
The collection is available via Ansible Galaxy. So you can run
ansible-galaxy collection install codeaffen.phpipam
Alternatively you can build and install the collection from source.
make dist
ansible-galaxy collection install codeaffen-phpipam-<version>.tar.gz
Current documentation can be found on readthedocs.io.
If you have installed the collection you can facilitate ansible-doc
to display documentation for a given module.
ansible-doc codeaffen.phpipam.section
A last option to read the docs is the docs folder in this repository.
The following dependencies have to be fulfiled by the Ansible controller.
- colour
- geopy
- inflection
- ipaddress
- phpypam>=1.0.0
To ensure phpipam-ansible-modules
work correctly with phpIPAM versions 1.7 and above, you need to modify the phpIPAM configuration to stringify API results. This is crucial because newer phpIPAM versions might return numerical values directly, which the Ansible modules might expect as strings.
Here's how to implement the workaround:
1. Modify phpIPAM Configuration
You need to set the api_stringify_results
variable to true
in your phpIPAM configuration. This change should be made in the config.php
file, which is typically located in the phpIPAM installation directory (e.g., /var/www/html/phpipam/config.php
or /var/www/phpipam/config.php
).
Add or modify the following line in your config.php
file:
<?php
/*
* phpIPAM config.php
*
* ... existing configuration ...
*/
// Required for Ansible modules with phpIPAM v1.7 and above
$api_stringify_results = true;
/*
* ... rest of your configuration ...
*/
?>
If you’ve found any issues in this release please head over to github and open a bug so we can take a look.