adds name server group support to nios_zone (#37543)

* adds name server group support to nios_zone

* fixes style issues

* adds support for restart_if_needed

* adds type: bool to documentation for restart_if_needed

* doc fix
This commit is contained in:
Blair Rampling 2018-05-28 03:07:47 -07:00 committed by Sumit Jaiswal
parent 7b9864776a
commit 9785cab973

View file

@ -47,7 +47,6 @@ options:
name: name:
description: description:
- The name of the grid primary server - The name of the grid primary server
required: true
grid_secondaries: grid_secondaries:
description: description:
- Configures the grid secondary servers for this zone. - Configures the grid secondary servers for this zone.
@ -55,7 +54,17 @@ options:
name: name:
description: description:
- The name of the grid secondary server - The name of the grid secondary server
required: true ns_group:
version_added: "2.6"
description:
- Configures the name server group for this zone. Name server group is
mutually exclusive with grid primary and grid secondaries.
restart_if_needed:
version_added: "2.6"
description:
- If set to true, causes the NIOS DNS service to restart and load the
new zone configuration
type: bool
extattrs: extattrs:
description: description:
- Allows for the configuration of Extensible Attributes on the - Allows for the configuration of Extensible Attributes on the
@ -79,9 +88,27 @@ options:
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: configure a zone on the system - name: configure a zone on the system using grid primary and secondaries
nios_zone: nios_zone:
name: ansible.com name: ansible.com
grid_primary:
- name: gridprimary.grid.com
grid_secondaries:
- name: gridsecondary1.grid.com
- name: gridsecondary2.grid.com
restart_if_needed: true
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
- name: configure a zone on the system using a name server group
nios_zone:
name: ansible.com
ns_group: examplensg
restart_if_needed: true
state: present state: present
provider: provider:
host: "{{ inventory_hostname_short }}" host: "{{ inventory_hostname_short }}"
@ -132,6 +159,8 @@ def main():
grid_primary=dict(type='list', elements='dict', options=grid_spec), grid_primary=dict(type='list', elements='dict', options=grid_spec),
grid_secondaries=dict(type='list', elements='dict', options=grid_spec), grid_secondaries=dict(type='list', elements='dict', options=grid_spec),
ns_group=dict(),
restart_if_needed=dict(type='bool'),
extattrs=dict(type='dict'), extattrs=dict(type='dict'),
comment=dict() comment=dict()
@ -146,7 +175,11 @@ def main():
argument_spec.update(WapiModule.provider_spec) argument_spec.update(WapiModule.provider_spec)
module = AnsibleModule(argument_spec=argument_spec, module = AnsibleModule(argument_spec=argument_spec,
supports_check_mode=True) supports_check_mode=True,
mutually_exclusive=[
['ns_group', 'grid_primary'],
['ns_group', 'grid_secondaries']
])
wapi = WapiModule(module) wapi = WapiModule(module)
result = wapi.run('zone_auth', ib_spec) result = wapi.run('zone_auth', ib_spec)