Documenting how to use miq-infoblox custom domain from Red Hat

I can’t find any guides or docs on how to use the Red Hat miq-infoblox custom domain found on GitHub to integrate MIQ with InfoBlox. So I’m starting this thread to solicit input and provide an answer to others searching for the same thing.

Note, this article from @jhardy from 2013 is the closest thing I can find to a guide, but it apparently predates the current miq-infoblox domain. But thanks to John for providing this starting point.

Backup your Automate Datastore code in case the following changes mess it up:
You should always do this before editing your code.

Install Prerequisites:
The miq-infoblox domain requires you first install miq-utilities, found here. The readme provides simple install instructions.

Install miq-infoblox:
Found here. Again the readme tells you what to do.

Unlock the RedHatConsulting_Infoblox Domain
You have to unlock the RedHatConsulting_Infoblox domain before you can edit it. Use the following from a rails console MiqAeDomain.where(:name => 'RedHatConsulting_Infoblox').update_attributes(:source => 'user')
FYI to lock the ManageIQ domain use the following from a rails console
MiqAeDomain.where(:name => 'RedHatConsulting_Infoblox').update_attributes(:source => 'system')

Configure the Infoblox > Configuration class:
Go to RedHatConsulting_Infoblox > Integration > Infoblox > Configuration class in the Automate Datastore. Add your username, password and server to the schema attributes.

Adjust the VM Provisioning State Machine:
Copy the OOTB Class ‘VMProvision_VM’ found at ManageIQ (Domain) > Cloud > VM > Provisioning > StateMachines > VMProvision_VM to a custom domain if it doesn’t already exist in one of your custom domains.

Add acquire_ip_address to the AcquireIPAddress state value
add /RedHatConsulting_Infoblox/Integration/Infoblox/Operations/Methods/acquire_ip_address here:

Save changes. I will edit/add to this post based on further research, testing, and feedback from others who feel inclined to provide it. Thanks!

1 Like

Hello Michael,

I have worked on CloudForms with Infoblox integration using Ansible Playbooks. As Ansible is super compatible with newer versions of CloudForms so I found it really simple and effective approach for Integration.

You can refer the playbooks here: https://github.com/cNeha/infoblox

This has been tested on CloudForms 4.7 and it works as expected.

Let me know if you need more information regarding the same, would be happy to help you.

Regards,
Neha Chugh

1 Like

Thank you @cNeha! What would the pros and cons be of using miq-infoblox vs using Ansible? I guess I’m assuming that direct integration from MIQ would be easier, but I’m open to another approach. Ansible was my first approach before learning of this domain from Red Hat.

Hello Michael,

Any approach would be fine as far as you are comfortable with. I chose Ansible as it is more compatible now with newer versions and due to syncrou-role which can be used to get/set attribute from one state to another state.

Ansible was introduced in Cloudforms 4.5 version, before that, miq-infoblox was the only solution to integrate with Infoblox using ruby scripts.

With the help of available ansible modules for Infoblox and syncrou roles, it is quite easy to work with Ansible playbooks and integrate cloudforms with Infoblox.

Both the approaches are equally good in terms of performance. So, you can choose any approach which suits your need.

If you want to opt for Ansible, would happy to assist you in achieving the same.

Regards,
Neha Chugh

Thank you @cNeha that is very generous of you. I will let you know if I explore the Ansible path and get stuck!

@cNeha do you use the embedded Ansible or Ansible Tower?

I think Neha used Embedded Ansible for this.

Thanks,
pemcg

Thank you @pemcg

I’m no longer able to edit my original post. I set out to share my learnings as I sorted out how to use the miq-infoblox domain. However, in the end I abandoned that solution in favor of Ansible Tower / AWX. I suggest anyone trying to sort out how to integrate MIQ with Infoblox do likewise, or also consider embedded ansible if that works for you.

Hi @michaelbutak, as a matter of interest did you use Neha’s playbooks that she referred to earlier, or did you find or create different ones? If different ones, are you able to share the repo here?

Thanks
pemcg

Hi @pemcg. Thank you for asking. A linux admin in our org who is very experienced with Ansible shared his infoblox playbook with me which requires very little tweaking to do just what I needed. I can’t share the repo as it’s on internal source control, but I can post the code here when I’m through with it. (I’m still working out how to properly integrate with MIQ. So far I’m successfully calling and running the job from my automate script, and I can pass variables to the playbook and print them. I am still figuring out how to catch any sort of response from Ansible (for starters, the next available IP Address) and then incorporate that into the provisioning process. It’s easy to insert my template-calling instance into the provisioning state machine under the Acquire IP Address state. But it seems like I should have to “turn off” something else, whatever was previously acquiring an IP address. And I don’t yet know what that something else is.)

So no, I didn’t use Neha’s playbooks. When she shared it I didn’t grasp the difference between embedded ansible and integrated Tower/AWX (bc I didn’t realize that AWX/Tower was optional add-on to Ansible). Since the contractors who set up our MIQ instance had used Tower integrations, I didn’t dig into her code too much, being under the impression that I should follow their pattern using tower. Now that I’m grasping how playbooks, roles, etc. are structured, I started peeking at her code. I’m drinking out of a fire hose as I’m simultaneously learning how to deploy big data services to Azure from python sdk scripts in GitLab Runner, and containerization in Azure. Oh and linux administration… and networking! Your resources have been SOOOOO helpful to me.