Skip to content
Snippets Groups Projects
Commit 9d088983 authored by Thomas Woerner's avatar Thomas Woerner
Browse files

ipaserver_setup_dns: Properly set ip_addresses, domain and realm

The parameters ip_addresses, domain and realm have not been properly set
for the setup of dns if _setup_dns as not enabled.
parent b0da219b
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,9 @@ def main(): ...@@ -64,6 +64,9 @@ def main():
ansible_module = AnsibleModule( ansible_module = AnsibleModule(
argument_spec = dict( argument_spec = dict(
### basic ### ### basic ###
ip_addresses=dict(required=False, type='list', default=[]),
domain=dict(required=True),
realm=dict(required=True),
hostname=dict(required=True), hostname=dict(required=True),
### server ### ### server ###
setup_dns=dict(required=True, type='bool'), setup_dns=dict(required=True, type='bool'),
...@@ -86,6 +89,10 @@ def main(): ...@@ -86,6 +89,10 @@ def main():
# set values ############################################################ # set values ############################################################
### basic ### ### basic ###
options.ip_addresses = ansible_module_get_parsed_ip_addresses(
ansible_module)
options.domain_name = ansible_module.params.get('domain')
options.realm_name = ansible_module.params.get('realm')
options.host_name = ansible_module.params.get('hostname') options.host_name = ansible_module.params.get('hostname')
### server ### ### server ###
options.setup_dns = ansible_module.params.get('setup_dns') options.setup_dns = ansible_module.params.get('setup_dns')
...@@ -116,8 +123,9 @@ def main(): ...@@ -116,8 +123,9 @@ def main():
# Create a BIND instance # Create a BIND instance
bind = bindinstance.BindInstance(fstore) bind = bindinstance.BindInstance(fstore)
bind.set_output(ansible_log) bind.set_output(ansible_log)
bind.setup(host_name, ip_addresses, realm_name, bind.setup(options.host_name, options.ip_addresses,
domain_name, (), 'first', (), options.realm_name,
options.domain_name, (), 'first', (),
zonemgr=options.zonemgr, zonemgr=options.zonemgr,
no_dnssec_validation=options.no_dnssec_validation) no_dnssec_validation=options.no_dnssec_validation)
bind.create_file_with_system_records() bind.create_file_with_system_records()
......
...@@ -333,6 +333,9 @@ ...@@ -333,6 +333,9 @@
- name: Install - Setup DNS - name: Install - Setup DNS
ipaserver_setup_dns: ipaserver_setup_dns:
ip_addresses: "{{ ipaserver_ip_addresses | default([]) }}"
domain: "{{ result_ipaserver_test.domain }}"
realm: "{{ result_ipaserver_test.realm }}"
hostname: "{{ result_ipaserver_test.hostname }}" hostname: "{{ result_ipaserver_test.hostname }}"
setup_ca: "{{ result_ipaserver_test.setup_ca }}" setup_ca: "{{ result_ipaserver_test.setup_ca }}"
setup_dns: "{{ ipaserver_setup_dns }}" setup_dns: "{{ ipaserver_setup_dns }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment