summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/server
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2016-06-13 20:41:24 +0200
committerMartin Basti <mbasti@redhat.com>2016-06-17 15:22:24 +0200
commit52590d6fa581e3b53e2c9350dc307a1f360c40a3 (patch)
treee7973258e4dbac1d4a4442e6dfc272c5e8c21ce9 /ipaserver/install/server
parent2157ea0e6d0d762bdc71022ddd55045406c4b300 (diff)
downloadfreeipa-52590d6fa581e3b53e2c9350dc307a1f360c40a3.tar.gz
freeipa-52590d6fa581e3b53e2c9350dc307a1f360c40a3.tar.xz
freeipa-52590d6fa581e3b53e2c9350dc307a1f360c40a3.zip
DNS Locations: dnsserver: put server_id option into named.conf
The option server_id is required for DNS location feature, otherwise it will not work. https://fedorahosted.org/freeipa/ticket/2008 Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/install/server')
-rw-r--r--ipaserver/install/server/upgrade.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
index eacd43939..b4b6243ac 100644
--- a/ipaserver/install/server/upgrade.py
+++ b/ipaserver/install/server/upgrade.py
@@ -842,6 +842,28 @@ def named_update_global_forwarder_policy():
return True
+def named_add_server_id():
+ """
+ DNS Locations feature requires to have configured server_id in IPA section
+ of named.conf
+ :return: if named.conf has been changed
+ """
+ bind = bindinstance.BindInstance()
+ if not bindinstance.named_conf_exists() or not bind.is_configured():
+ # DNS service may not be configured
+ root_logger.info('DNS is not configured')
+ return False
+
+ if sysupgrade.get_upgrade_state('named.conf', 'add_server_id'):
+ # upgrade was done already
+ return False
+
+ root_logger.info('[Adding server_id to named.conf]')
+ bindinstance.named_conf_set_directive('server_id', api.env.host)
+ sysupgrade.set_upgrade_state('named.conf', 'add_server_id', True)
+ return True
+
+
def certificate_renewal_update(ca, ds, http):
"""
Update certmonger certificate renewal configuration.
@@ -1680,6 +1702,7 @@ def upgrade_configuration():
named_update_global_forwarder_policy(),
mask_named_regular(),
fix_dyndb_ldap_workdir_permissions(),
+ named_add_server_id(),
)
if any(named_conf_changes):