ipareplica_setup_ds: Use inspect on install_replica_ds and install_dns_records

The promote argument has been dropped with the final removal of domain
level 0 support in version 4.7.1. The fstore argument has been added
with the 4.7.1 version also.
This commit is contained in:
Thomas Woerner
2019-03-26 12:48:56 +01:00
parent b8dd597a69
commit 9fb32b2322

View File

@@ -313,15 +313,35 @@ def main():
ansible_log.debug("-- CONFIGURE DIRSRV --")
# Configure dirsrv
with redirect_stdout(ansible_log):
ds = install_replica_ds(config, options, ca_enabled,
remote_api,
ca_file=cafile,
promote=promote,
pkcs12_info=dirsrv_pkcs12_info)
argspec = inspect.getargspec(install_replica_ds)
if "promote" in argspec.args:
ds = install_replica_ds(config, options, ca_enabled,
remote_api,
ca_file=cafile,
promote=promote,
pkcs12_info=dirsrv_pkcs12_info)
else:
if "fstore" in argspec.args:
ds = install_replica_ds(config, options, ca_enabled,
remote_api,
ca_file=cafile,
pkcs12_info=dirsrv_pkcs12_info,
fstore=fstore)
else:
ds = install_replica_ds(config, options, ca_enabled,
remote_api,
ca_file=cafile,
pkcs12_info=dirsrv_pkcs12_info)
ansible_log.debug("-- INSTALL DNS RECORDS --")
# Always try to install DNS records
install_dns_records(config, options, remote_api)
argspec = inspect.getargspec(install_dns_records)
if "fstore" not in argspec.args:
install_dns_records(config, options, remote_api)
else:
install_dns_records(config, options, remote_api, fstore=fstore)
# TODO: check if ntp needs to be enabled later on
ansible_log.debug("-- NTP LDAP ENABLE --")
if ntpinstance is not None: