community.windows.win_dns_zone – Manage Windows Server DNS Zones¶
Note
This plugin is part of the community.windows collection (version 1.3.0).
To install it use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_dns_zone
.
Synopsis¶
Manage Windows Server DNS Zones
Adds, Removes and Modifies DNS Zones - Primary, Secondary, Forwarder & Stub
Task should be delegated to a Windows DNS Server
Requirements¶
The below requirements are needed on the host that executes this module.
This module requires Windows Server 2012R2 or Newer
Parameters¶
Examples¶
- name: Ensure primary zone is present
community.windows.win_dns_zone:
name: wpinner.euc.vmware.com
replication: domain
type: primary
state: present
- name: Ensure DNS zone is absent
community.windows.win_dns_zone:
name: jamals.euc.vmware.com
state: absent
- name: Ensure forwarder has specific DNS servers
community.windows.win_dns_zone:
name: jamals.euc.vmware.com
type: forwarder
dns_servers:
- 10.245.51.100
- 10.245.51.101
- 10.245.51.102
- name: Ensure stub zone has specific DNS servers
community.windows.win_dns_zone:
name: virajp.euc.vmware.com
type: stub
dns_servers:
- 10.58.2.100
- 10.58.2.101
- name: Ensure stub zone is converted to a secondary zone
community.windows.win_dns_zone:
name: virajp.euc.vmware.com
type: secondary
- name: Ensure secondary zone is present with no replication
community.windows.win_dns_zone:
name: dgemzer.euc.vmware.com
type: secondary
replication: none
dns_servers:
- 10.19.20.1
- name: Ensure secondary zone is converted to a primary zone
community.windows.win_dns_zone:
name: dgemzer.euc.vmware.com
type: primary
replication: none
dns_servers:
- 10.19.20.1
- name: Ensure primary DNS zone is present without replication
community.windows.win_dns_zone:
name: basavaraju.euc.vmware.com
replication: none
type: primary
- name: Ensure primary DNS zone has nonsecureandsecure dynamic updates enabled
community.windows.win_dns_zone:
name: basavaraju.euc.vmware.com
replication: none
dynamic_update: nonsecureandsecure
type: primary
- name: Ensure DNS zone is absent
community.windows.win_dns_zone:
name: marshallb.euc.vmware.com
state: absent
- name: Ensure DNS zones are absent
community.windows.win_dns_zone:
name: "{{ item }}"
state: absent
loop:
- jamals.euc.vmware.com
- dgemzer.euc.vmware.com
- wpinner.euc.vmware.com
- marshallb.euc.vmware.com
- basavaraju.euc.vmware.com
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Joe Zollo (@joezollo)