- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Restart DHCP services with ansible?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 06:49 AM
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
Solved! Go to Solution.
Re: Restart DHCP services with ansible?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2019 09:52 AM
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 uri: 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 headers: Content-Type: "application/json" validate_certs: False delegate_to: localhost
Re: Restart DHCP services with ansible?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 07:08 AM
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:
[ { "_ref": "grid/XXXXXXXXXXXXXXXXXX:MY_DDI" } ]
Re: Restart DHCP services with ansible?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 05:26 AM
You could also use the ansible infoblox module to restart the services: https://docs.ansible.com/ansible/latest/collections/infoblox/nios_modules/nios_restartservices_modul...
Complete documentation and installation guide is here: https://docs.ansible.com/ansible/latest/scenario_guides/guide_infoblox.html