ansible,

Ansible for Infoblox

Gini Gini Follow · 2 mins read
Ansible for Infoblox
Share this

Configure Ansible for Infoblox

Install Python3 on RHEL

https://developers.redhat.com/blog/2018/08/13/install-python3-rhel/#why-rhscl

$ su -
# subscription-manager repos --enable rhel-7-server-optional-rpms \
  --enable rhel-server-rhscl-7-rpms
# yum -y install @development
# yum -y install rh-python36
 
# yum -y install rh-python36-numpy \
 rh-python36-scipy \ 
 rh-python36-python-tools \
 rh-python36-python-six

Instal Python3 on Centos

# yum install -y python3

Setup Python VirtualEnv (venv)

$ scl enable rh-python36 bash
$ python3 -V
Python 3.6.3
 
$ python -V  # python now also points to Python3 
Python 3.6.3
 
$ mkdir ~/pydev
$ cd ~/pydev
 
$ python3 -m venv py36-venv
$ source py36-venv/bin/activate
 
(py36-venv) $ python3 -m pip install ...some modules...

DONOT Upgrade pip to Latest !!!

$ python -m pip install pip==20.2.3

Install Ansible

## install required packages
pip install wheel setuptools rust etc

pip install ansible

Install infoblox Client

pip install infoblox-client

Infoblox API References

Find the WAPI documentation from https://<GRID_IP_ADDRESS>/wapidoc/ url.

## list WAPI versions
https://10.10.10.10/wapi/v1.0/?_schema

## samples
https://10.6.1.216/wapi/v2.7/networkview?name=default
https://10.6.1.216/wapi/v2.7/networkview?name=default&_return_type=json

## get the rpz url entry
https:///wapi//allrpzrecords?zone=&_return_fields%2B=rpz_rule&_return_as_object=1&name="

Sample API Calls

$ curl -k -s \
  -H 'content-type: application/json' \
  -X POST \
  --user admin:adminadmin \
  "https://10.6.1.216/wapi/v2.7/record:rpz:a?_return_fields%2B=name,rp_zone&_return_as_object=1" \
  -d '{"name":"serverblock.com.category-01","ipv4addr":"1.1.1.156","rp_zone":"category-01"}'

  "https://10.6.1.216/wapi/v2.11/record:rpz:a?_return_fields%2B=name,rp_zone&_return_as_object=1"

Appendix

Gini
Written by Gini Follow
Backpacker, Foodie, Techie

Latest Stories

How To Get Hands-On Experience in AWS

Every Time you have the same situation, you know the technology and maybe you are already a certified professional in that technology, but you are not getting enough hands-on on that ...

In AWS, Jan 04, 2021
Getting Started with Ansible Collections

Ansible Collection is a great way of getting content contributions from various Ansible Developers. Earlier there was a tagline for Ansible – “Batteries included”, but now the battery...

In redhat, ansible, Dec 22, 2020
Configure Your Windows Host to be Managed by Ansible

I was talking to my friend about Ansible automation and how we are implementing automated solutions for cloud and on-premise infrastructure. Then he told me that, his team is looking ...

In redhat, ansible, Dec 01, 2020
Remove nodes from Kubespray Managed Kubernetes Cluster

Kubespray is a combination of Ansible and Kubernetes and you can use Kubespray for deploying production ready Kubernetes clusters. You can manage full-lifecycle of Kubernetes clusters...

In containers, kubernetes, Nov 30, 2020
Adding new nodes to Kubespray Managed Kubernetes Cluster

Kubespray is a combination of Ansible and Kubernetes and you can use Kubespray for deploying production ready Kubernetes clusters. Learn how to add new nodes in a Kubernetes cluster u...

In containers, kubernetes, Nov 27, 2020

Featured