summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/windows
diff options
context:
space:
mode:
authorJohn Nelson <john@jnelson.ca>2020-02-25 14:03:03 -0700
committerGitHub <noreply@github.com>2020-02-25 16:03:03 -0500
commite9f22a22693d1cc2ca4da02490e9a3589cb9fe36 (patch)
tree5cb6949f0f4d5963f34f75a9ccea4a9cfdfaa652 /lib/ansible/modules/windows
parent1b5c69deefe7fe5e14b37f93b8a2aab90e6663be (diff)
downloadansible-e9f22a22693d1cc2ca4da02490e9a3589cb9fe36.tar.gz
win_dns_record: Improve examples documentation (#67744)
Diffstat (limited to 'lib/ansible/modules/windows')
-rw-r--r--lib/ansible/modules/windows/win_dns_record.py45
1 files changed, 40 insertions, 5 deletions
diff --git a/lib/ansible/modules/windows/win_dns_record.py b/lib/ansible/modules/windows/win_dns_record.py
index 92e93c1e31..0d5e631072 100644
--- a/lib/ansible/modules/windows/win_dns_record.py
+++ b/lib/ansible/modules/windows/win_dns_record.py
@@ -70,26 +70,61 @@ options:
'''
EXAMPLES = r'''
-- name: Create database server alias
+# Demonstrate creating a matching A and PTR record.
+
+- name: Create database server record
win_dns_record:
- name: "db1"
- type: "CNAME"
- value: "cgyl1404p.amer.example.com"
+ name: "cgyl1404p.amer.example.com"
+ type: "A"
+ value: "10.1.1.1"
zone: "amer.example.com"
-- name: PTR example
+- name: Create matching PTR record
win_dns_record:
name: "1.1.1"
type: "PTR"
value: "db1"
zone: "10.in-addr.arpa"
+# Demonstrate replacing an A record with a CNAME
+
- name: Remove static record
win_dns_record:
name: "db1"
type: "A"
state: absent
zone: "amer.example.com"
+
+- name: Create database server alias
+ win_dns_record:
+ name: "db1"
+ type: "CNAME"
+ value: "cgyl1404p.amer.example.com"
+ zone: "amer.example.com"
+
+# Demonstrate creating multiple A records for the same name
+
+- name: Create multiple A record values for www
+ win_dns_record:
+ name: "www"
+ type: "A"
+ values:
+ - 10.0.42.5
+ - 10.0.42.6
+ - 10.0.42.7
+ zone: "example.com"
+
+# Demonstrates a partial update (replace some existing values with new ones)
+# for a pre-existing name
+
+- name: Update www host with new addresses
+ win_dns_record:
+ name: "www"
+ type: "A"
+ values:
+ - 10.0.42.5 # this old value was kept (others removed)
+ - 10.0.42.12 # this new value was added
+ zone: "example.com"
'''
RETURN = r'''