Skip to content

Commit ec09f1c

Browse files
committed
Updated readme with workaround for phpIPAM v1.7 and above
1 parent f3aaaa8 commit ec09f1c

3 files changed

Lines changed: 29 additions & 5 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,34 @@ The following dependencies have to be fulfiled by the Ansible controller.
5151
* ipaddress
5252
* phpypam>=1.0.0
5353

54+
## Compatibility notice
55+
56+
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.
57+
58+
Here's how to implement the workaround:
59+
60+
**1. Modify phpIPAM Configuration**
61+
62+
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`).
63+
64+
Add or modify the following line in your `config.php` file:
65+
66+
```
67+
<?php
68+
/*
69+
* phpIPAM config.php
70+
*
71+
* ... existing configuration ...
72+
*/
73+
74+
// Required for Ansible modules with phpIPAM v1.7 and above
75+
$api_stringify_results = true;
76+
77+
/*
78+
* ... rest of your configuration ...
79+
*/
80+
?>
81+
```
5482
## Need help?
5583

5684
If you’ve found any issues in this release please head over to github and open a bug so we can take a look.

tests/docker/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
services:
32
phpipam:
43
image: "phpipam/phpipam-www:${PHPIPAM_VERSION:-v1.4.4}"

tests/docker/setup_phpipam.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
exec 10>&1
44
exec > /dev/null 2>&1
55

6-
# split version number into semvar parts
7-
read -r MAJOR MINOR PATCH <<<$(echo ${PHPIPAM_VERSION#v} | tr . " ")
8-
96
function info() {
107
echo "${@}" >&10
118
}
@@ -19,7 +16,7 @@ fi
1916

2017
if "${DOCKER_CMD}" ps | grep -q phpipam_test_webserver && ! eval "${MYSQL_PING}" ; then
2118

22-
if [[ ${MINOR} -ge 7 ]] ; then
19+
if [[ $(echo ${PHPIPAM_VERSION:-v1.4.4} | sed -E 's/v[0-9]?.([0-9]?).[0-9]?/\1/g') -ge 7 ]] ; then
2320
info "Running version 1.7.0 or above, patching config"
2421
${DOCKER_CMD} exec -t phpipam_test_webserver sh -c 'sed -i "s/api_stringify_results = false/api_stringify_results = true/g" /phpipam/config.dist.php'
2522
fi

0 commit comments

Comments
 (0)