- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Ansible Forward to external DNS server
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2021 05:11 AM
Hi
I'm got a playbook that can create a zone on InfoBlox when Infoblox is Authorative for that zone, but I am wondeirng if it's possible to create a forward zone with Ansible. I'm read the docs but found them confusing.
Solved! Go to Solution.
Re: Ansible Forward to external DNS server
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2021 06:18 AM
Hi,
We don't have in-built Ansible modules for forward zones. However, you can leverage the URI module available in Ansible to fire up the REST API for forward zones. Here is a snippet you can use:
--- - hosts: localhost vars: host: grid-master.demo.com username: cloudadmin password: pwd wapi_version: 'v2.10' connection: local tasks: - name: Create a forward zone uri: url: "https://{{ host }}/wapi/{{ wapi_version }}/zone_forward" user: "{{ username }}" password: "{{ password }}" validate_certs: no return_content: yes method: POST force_basic_auth: yes status_code: 201, 302, 200 headers: Content-Type: "application/json" body: fqdn: infoblox.com forward_to: - address: 10.10.10.11 name: host.infoblox.com body_format: json
Hope this helps,
Krishna Vasudevan
Re: Ansible Forward to external DNS server
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2021 07:25 AM
Thanks, this worked.
As a follow up is it possible to just modify the addess's being used with that snippet?
Re: Ansible Forward to external DNS server
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 11:29 AM
This worked to add a forward zone and set the forward IPs. However, it does not work (on my setup at least) because it does not set anything under the 'Name Servers' tab (see below). How would I add these using the playbook?
Re: Ansible Forward to external DNS server
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2023 07:38 AM
how do you then update this as I get an error saying you must have a ref to patch. Are we suppose to query to see if it exist and then pass the ref on a update?