summaryrefslogtreecommitdiffstats
path: root/roles/lib_dyn/library
diff options
context:
space:
mode:
authorRussell Harrison <rharrison@fedoraproject.org>2016-02-16 14:57:27 -0500
committerRussell Harrison <rharrison@fedoraproject.org>2016-02-16 14:57:27 -0500
commit420420684214555b9a02bbd17d2902a2475b24d5 (patch)
tree0caee675199b74068cc71ea1c14e52ebeb2569f8 /roles/lib_dyn/library
parentc6a5132b78d29621299ec85d28dac10b8bee5501 (diff)
parentfb0b890d7f707dc038a3ee1a042a28bd3d644c71 (diff)
downloadopenshift-420420684214555b9a02bbd17d2902a2475b24d5.tar.gz
openshift-420420684214555b9a02bbd17d2902a2475b24d5.tar.bz2
openshift-420420684214555b9a02bbd17d2902a2475b24d5.tar.xz
openshift-420420684214555b9a02bbd17d2902a2475b24d5.zip
Merge pull request #1417 from rharrison10/rharriso/dyn
Adding examples to the dyn_record module
Diffstat (limited to 'roles/lib_dyn/library')
-rw-r--r--roles/lib_dyn/library/dyn_record.py30
1 files changed, 25 insertions, 5 deletions
diff --git a/roles/lib_dyn/library/dyn_record.py b/roles/lib_dyn/library/dyn_record.py
index f2796ccf2..609fa8679 100644
--- a/roles/lib_dyn/library/dyn_record.py
+++ b/roles/lib_dyn/library/dyn_record.py
@@ -95,6 +95,26 @@ requirements: [ dyn ]
author: "Russell Harrison"
'''
+EXAMPLES = '''
+- name: Update CNAME record
+ local_action:
+ module: dyn_record
+ state: present
+ record_fqdn: www.example.com
+ zone: example.com
+ record_type: CNAME
+ record_value: web1.example.com
+
+- name: Update A record
+ local_action:
+ module: dyn_record
+ state: present
+ record_fqdn: web1.example.com
+ zone: example.com
+ record_value: 10.0.0.10
+ record_type: A
+'''
+
try:
IMPORT_ERROR = False
from dyn.tm.session import DynectSession
@@ -158,15 +178,15 @@ def main():
'''Ansible module for managing Dyn DNS records.'''
module = AnsibleModule(
argument_spec=dict(
- state=dict(required=True, choices=['present', 'absent', 'list']),
+ state=dict(required=True, default='present', choices=['present', 'absent', 'list']),
customer_name=dict(default=os.environ.get('DYNECT_CUSTOMER_NAME', None), type='str'),
user_name=dict(default=os.environ.get('DYNECT_USER_NAME', None), type='str', no_log=True),
user_password=dict(default=os.environ.get('DYNECT_PASSWORD', None), type='str', no_log=True),
- zone=dict(required=True),
- record_fqdn=dict(required=False),
- record_type=dict(required=False, choices=[
+ zone=dict(required=True, type='str'),
+ record_fqdn=dict(required=False, type='str'),
+ record_type=dict(required=False, type='str', choices=[
'A', 'AAAA', 'CNAME', 'PTR', 'TXT']),
- record_value=dict(required=False),
+ record_value=dict(required=False, type='str'),
record_ttl=dict(required=False, default=0, type='int'),
),
required_together=(