exoscale: exo_dns: fix sanity checks (#58312)

pull/58355/head
René Moser 5 years ago committed by GitHub
parent 7fd10d821c
commit 360a9f1a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,24 +26,23 @@ options:
description: description:
- Name of the record. - Name of the record.
required: true required: true
type: str
state: state:
description: description:
- State of the resource. - State of the resource.
required: false default: present
default: 'present' choices: [ present, absent ]
choices: [ 'present', 'absent' ] type: str
extends_documentation_fragment: exoscale extends_documentation_fragment: exoscale
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: Create a domain - name: Create a domain
local_action: exo_dns_domain:
module: exo_dns_domain
name: example.com name: example.com
- name: Remove a domain - name: Remove a domain
local_action: exo_dns_domain:
module: exo_dns_domain
name: example.com name: example.com
state: absent state: absent
''' '''
@ -186,8 +185,8 @@ class ExoDnsDomain(ExoDns):
def main(): def main():
argument_spec = exo_dns_argument_spec() argument_spec = exo_dns_argument_spec()
argument_spec.update(dict( argument_spec.update(dict(
name=dict(required=True), name=dict(type='str', required=True),
state=dict(choices=['present', 'absent'], default='present'), state=dict(type='str', choices=['present', 'absent'], default='present'),
)) ))
module = AnsibleModule( module = AnsibleModule(

@ -26,34 +26,40 @@ options:
description: description:
- Name of the record. - Name of the record.
default: "" default: ""
type: str
domain: domain:
description: description:
- Domain the record is related to. - Domain the record is related to.
required: true required: true
type: str
record_type: record_type:
description: description:
- Type of the record. - Type of the record.
default: A default: A
choices: [ A, ALIAS, CNAME, MX, SPF, URL, TXT, NS, SRV, NAPTR, PTR, AAAA, SSHFP, HINFO, POOL ] choices: [ A, ALIAS, CNAME, MX, SPF, URL, TXT, NS, SRV, NAPTR, PTR, AAAA, SSHFP, HINFO, POOL ]
aliases: [ rtype, type ] aliases: [ rtype, type ]
type: str
content: content:
description: description:
- Content of the record. - Content of the record.
- Required if C(state=present) or C(multiple=yes). - Required if C(state=present) or C(multiple=yes).
aliases: ['value', 'address'] aliases: [ value, address ]
type: str
ttl: ttl:
description: description:
- TTL of the record in seconds. - TTL of the record in seconds.
default: 3600 default: 3600
type: int
prio: prio:
description: description:
- Priority of the record. - Priority of the record.
aliases: [ priority ] aliases: [ priority ]
type: int
multiple: multiple:
description: description:
- Whether there are more than one records with similar C(name) and C(record_type). - Whether there are more than one records with similar I(name) and I(record_type).
- Only allowed for a few record types, e.g. C(record_type=A), C(record_type=NS) or C(record_type=MX). - Only allowed for a few record types, e.g. C(record_type=A), C(record_type=NS) or C(record_type=MX).
- C(content) will not be updated, instead it is used as a key to find existing records. - I(content) will not be updated, instead it is used as a key to find existing records.
type: bool type: bool
default: no default: no
state: state:
@ -61,43 +67,39 @@ options:
- State of the record. - State of the record.
default: present default: present
choices: [ present, absent ] choices: [ present, absent ]
type: str
extends_documentation_fragment: exoscale extends_documentation_fragment: exoscale
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: Create or update an A record - name: Create or update an A record
local_action: exo_dns_record:
module: exo_dns_record
name: web-vm-1 name: web-vm-1
domain: example.com domain: example.com
content: 1.2.3.4 content: 1.2.3.4
- name: Update an existing A record with a new IP - name: Update an existing A record with a new IP
local_action: exo_dns_record:
module: exo_dns_record
name: web-vm-1 name: web-vm-1
domain: example.com domain: example.com
content: 1.2.3.5 content: 1.2.3.5
- name: Create another A record with same name - name: Create another A record with same name
local_action: exo_dns_record:
module: exo_dns_record
name: web-vm-1 name: web-vm-1
domain: example.com domain: example.com
content: 1.2.3.6 content: 1.2.3.6
multiple: yes multiple: yes
- name: Create or update a CNAME record - name: Create or update a CNAME record
local_action: exo_dns_record:
module: exo_dns_record
name: www name: www
domain: example.com domain: example.com
record_type: CNAME record_type: CNAME
content: web-vm-1 content: web-vm-1
- name: Create another MX record - name: Create another MX record
local_action: exo_dns_record:
module: exo_dns_record
domain: example.com domain: example.com
record_type: MX record_type: MX
content: mx1.example.com content: mx1.example.com
@ -105,8 +107,7 @@ EXAMPLES = '''
multiple: yes multiple: yes
- name: Delete one MX record out of multiple - name: Delete one MX record out of multiple
local_action: exo_dns_record:
module: exo_dns_record
domain: example.com domain: example.com
record_type: MX record_type: MX
content: mx1.example.com content: mx1.example.com
@ -114,8 +115,7 @@ EXAMPLES = '''
state: absent state: absent
- name: Remove a single A record - name: Remove a single A record
local_action: exo_dns_record:
module: exo_dns_record
name: www name: www
domain: example.com domain: example.com
state: absent state: absent
@ -310,14 +310,14 @@ class ExoDnsRecord(ExoDns):
def main(): def main():
argument_spec = exo_dns_argument_spec() argument_spec = exo_dns_argument_spec()
argument_spec.update(dict( argument_spec.update(dict(
name=dict(default=""), name=dict(type='str', default=''),
record_type=dict(choices=EXO_RECORD_TYPES, aliases=['rtype', 'type'], default='A'), record_type=dict(type='str', choices=EXO_RECORD_TYPES, aliases=['rtype', 'type'], default='A'),
content=dict(aliases=['value', 'address']), content=dict(type='str', aliases=['value', 'address']),
multiple=(dict(type='bool', default=False)), multiple=(dict(type='bool', default=False)),
ttl=dict(type='int', default=3600), ttl=dict(type='int', default=3600),
prio=dict(type='int', aliases=['priority']), prio=dict(type='int', aliases=['priority']),
domain=dict(required=True), domain=dict(type='str', required=True),
state=dict(choices=['present', 'absent'], default='present'), state=dict(type='str', choices=['present', 'absent'], default='present'),
)) ))
module = AnsibleModule( module = AnsibleModule(

@ -1607,9 +1607,6 @@ lib/ansible/modules/net_tools/dnsimple.py E337
lib/ansible/modules/net_tools/dnsimple.py E338 lib/ansible/modules/net_tools/dnsimple.py E338
lib/ansible/modules/net_tools/dnsmadeeasy.py E337 lib/ansible/modules/net_tools/dnsmadeeasy.py E337
lib/ansible/modules/net_tools/dnsmadeeasy.py E338 lib/ansible/modules/net_tools/dnsmadeeasy.py E338
lib/ansible/modules/net_tools/exoscale/exo_dns_domain.py E338
lib/ansible/modules/net_tools/exoscale/exo_dns_record.py E337
lib/ansible/modules/net_tools/exoscale/exo_dns_record.py E338
lib/ansible/modules/net_tools/ipinfoio_facts.py E337 lib/ansible/modules/net_tools/ipinfoio_facts.py E337
lib/ansible/modules/net_tools/ipinfoio_facts.py E338 lib/ansible/modules/net_tools/ipinfoio_facts.py E338
lib/ansible/modules/net_tools/ip_netns.py E338 lib/ansible/modules/net_tools/ip_netns.py E338

Loading…
Cancel
Save