# PHPIPAM

**URL:** <https://forum.ansible.com/t/phpipam/33061>\
**Category:** Ansible Project\
**Created:** [June 1, 2020, 8:30am UTC](https://forum.ansible.com/t/phpipam/33061 "2020-06-01T08:30:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naresh\_Kasula](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Naresh\_Kasula](https://forum.ansible.com/u/Naresh_Kasula)\
**Post date:** [June 1, 2020, 8:30am UTC](https://forum.ansible.com/t/phpipam/33061/1 "2020-06-01T08:30:27Z")

</div>

Hi Team,

I have installed PHPIPAM on linux centos server now want retrieve the subnet/ipaddress details using Ansible scripts.

Can someone please guide to get the details.

PHPIPAM is basically IPAddress management tool.

Regards,  
Naresh K

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [June 1, 2020, 8:27pm UTC](https://forum.ansible.com/t/phpipam/33061/2 "2020-06-01T20:27:01Z")

</div>

Ansible is an automation tool.  
It can automate whatever you are currently doing manually.  
So the question is: how are you currently "retrieving the  
subnet/ipaddress details"?

---

<div class="post-metadata">

**Author:** ![Naresh\_Kasula](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Naresh\_Kasula](https://forum.ansible.com/u/Naresh_Kasula)\
**Post date:** [June 2, 2020, 6:48am UTC](https://forum.ansible.com/t/phpipam/33061/3 "2020-06-02T06:48:24Z")

</div>

Hi Dick Visser,

Am fine…thanks for asking and how about

I have launched instance(CentOs) in AWS then i have installed PHPIPAM on that successfully and i have created subnets, customers, etc. Now want to see the information of subnets by using Ansilble scripts.

I have installed Ansible in the same machine and executed the below script. getting some authentication error

name: testing  
hosts: 127.0.0.1  
tasks:

- name: Login to phpIPAM  
uri:  
validate\_certs: false  
url: “[http://localhost/index.php?page=login](http://localhost/index.php?page=login)”  
method: POST  
body\_format: json  
user: “Admin”  
password: “admin123”  
force\_basic\_auth: yes  
register: ipam\_login

Error:

 ![image.png](https://us1.discourse-cdn.com/ansible/original/2X/e/e049317a35d9aec45dbc310055920d1b7164388f.png)

Through Ansible am not connecting PHPIPAM so once its connect then i can use below script to check the subnet information.

- name: Get subnet information (DNS, gateway, netmask etc.)  
uri:  
url: “{{ phpipam\_url }}/subnets/7/”  
method: GET  
headers:  
token: “{{ ipam\_login.json.data.token }}”  
status\_code: 200  
register: subnet\_info

Kindly help me out from this issue.

Regards,  
Naresh K

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [June 2, 2020, 7:50am UTC](https://forum.ansible.com/t/phpipam/33061/4 "2020-06-02T07:50:15Z")

</div>

> Hi Dick Visser,
> 
> Am fine..thanks for asking and how about
> 
> I have launched instance(CentOs) in AWS then i have installed PHPIPAM on that successfully and i have created subnets,  
> customers, etc. Now want to see the information of subnets by using Ansilble scripts.
> 
> I have installed Ansible in the same machine and executed the below script. getting some authentication error
> 
> name: testing  
> hosts: 127.0.0.1  
> tasks:  
> - name: Login to phpIPAM  
> uri:  
> validate\_certs: false  
> url: "[http://localhost/index.php?page=login&quot](http://localhost/index.php?page=login&quot);  
> method: POST  
> body\_format: json  
> user: "Admin"  
> password: "admin123"  
> force\_basic\_auth: yes  
> register: ipam\_login
> 
> Error:
> 
> image.png
> 
> Through Ansible am not connecting PHPIPAM so once its connect then i can use below script to check the subnet information.

Sorry, the picture is not intelligible in my Email client. Please post it in a way in can be easily read.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
