Skip to content
Dec 1 / Greg

Automating Infoblox DDI With The Ansible Automation Platform

Infoblox DDI is a very powerful/popular DHCP, DNS, and IPAM system used by enterprises world wide. I’ve heard customer after customer talk about it, so I thought I would take a look at adding it to my demos. Fortunately it’s super simple to sign up for a demo copy that will give you a repeatable 60 day trial. I grabbed the VMWare OVA file, told it to boot, gave it an IP, and then I was up and running.

Demo Video

Github Repo

Git Repo found here.

Building My Lab

My first playbook connects to the DDI server and builds the simple environment:

First things first; you are going to see this section in use with all of the nios modules and plugins:

      host: "{{ ddi_host }}"
      username: "{{ ddi_username }}"
      password: "{{ ddi_password }}"

This is the connection information used to access the DDI server. I’m passing the info into the playbook at runtime via a custom credential in Tower(my favorite way to store and use special credentials).

The first task utilizes a loop to create two forward zones, and
I then loop again and using the zone type of IPv4 create a couple of reverse IPv4 zones.
Both of these were dead simple to use.

Add Hosts And Next IPs

This playbook will take a hostname, and in this case the variable name for it is test_host and add it to DDI.

The second important variable is the subnet_range; this is the subnet the host’s IP address will be sourced from.

The first task will use the lookup host record plugin and check to see if the host entry already exists.
If it does exist, it will print out a message that says as much.
If the host entry doesn’t exist, the following tasks will use the “nios_next_ip” lookup plugin and create a host entry. The lookup plugin is really clever; it will query the subnet and return the next available IP in the range for use in your automation. You can then take that IP and assign it to your host.

Provision VMs Utilizing DDI Next IP

This playbook utilizes VMWare templates to provision new hosts. I’ve coupled the following playbook with surveys in my tower instance to clone VMWare templates to create new hosts, then use DDI to assign an IP to the host, and finally add the host entry which goes into the IPAM and DNS forward and reverse entries.

This playbook checks to see if the IP address is set to “ddi”; if it is, then it indicates DDI should do the lookup/creation of the IP.
It will first delete any old host entries for the specified host name, then it does a lookup for a new IP, it applies that IP to the VMWare template, and last it will register the host entry in DDI.


This brought a lot of pieces together for me(how automating server creation could tie all of the IP/DNS pieces together). I like the interface, it’s power, and it’s simplicity. Please leave me any questions or comments.

Thanks and happy automating.

Leave a Comment