Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.



Restart DHCP services with ansible?

Posts: 4
4116     0

As the title suggests, is it possible to restart the DHCP services using ansible with the Infoblox module? I have a playbook that does a whole slew of tasks but this is the one part that I am stuck. I am hoping there is a way since the the entire playbook relies on this. Thanks

Re: Restart DHCP services with ansible?

Posts: 4
4116     0

I was able to get this figured out by converting the curl API command to the URI method within ansible.


In case anything looks for this. This is what worked for me:


    - name: Restart Infoblox Services
        url: 'https://x.x.x.x/wapi/v2.9/grid/b45lLmNssXN6ZGIkMA:Infoblox?_function=restartservices'
        user: username
        password: password
        method: POST
        body: '{"restart_option": "RESTART_IF_NEEDED"}'
        body_format: json
          Content-Type: "application/json"
        validate_certs: False
      delegate_to: localhost

Re: Restart DHCP services with ansible?

Posts: 30
4116     0

I tried your example and it didn't work.

Reason was that your URL doesn't work when the name of the Infoblox grid was changed.

I found this in another thread:

curl -k1 -u user:password 'https://x.x.x.x/wapi/v2.5/grid'

will give you the _ref-link that is necessary for the URL to work:




Re: Restart DHCP services with ansible?

Posts: 2
4117     0

You could also use the ansible infoblox module to restart the services:


Complete documentation and installation guide is here:


Showing results for 
Search instead for 
Did you mean: 

Recommended for You