diff options
author | Russell Harrison <rharrison@fedoraproject.org> | 2016-02-16 14:57:27 -0500 |
---|---|---|
committer | Russell Harrison <rharrison@fedoraproject.org> | 2016-02-16 14:57:27 -0500 |
commit | 420420684214555b9a02bbd17d2902a2475b24d5 (patch) | |
tree | 0caee675199b74068cc71ea1c14e52ebeb2569f8 | |
parent | c6a5132b78d29621299ec85d28dac10b8bee5501 (diff) | |
parent | fb0b890d7f707dc038a3ee1a042a28bd3d644c71 (diff) | |
download | openshift-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
-rw-r--r-- | roles/lib_dyn/library/dyn_record.py | 30 |
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=( |