From e696566b4232d7326b6d7586e899fffc7464a56c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 19 May 2020 15:07:10 -0400 Subject: [PATCH] Add dns domain to deployment This permits the deployment profiles to pull in specified DNS domain. --- confluent_server/confluent/config/attributes.py | 3 +++ confluent_server/confluent/selfservice.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/config/attributes.py b/confluent_server/confluent/config/attributes.py index 44c85248..3537864b 100644 --- a/confluent_server/confluent/config/attributes.py +++ b/confluent_server/confluent/config/attributes.py @@ -491,6 +491,9 @@ node = { 'description': ('Fingerprint of the SSH key of the OS running on the ' 'system.'), }, + 'dns.domain': { + 'description': 'DNS Domain searched by default by the system' + }, 'dns.servers': { 'description': 'DNS Server or servers to provide to node', }, diff --git a/confluent_server/confluent/selfservice.py b/confluent_server/confluent/selfservice.py index a12eba1c..55ecd3b1 100644 --- a/confluent_server/confluent/selfservice.py +++ b/confluent_server/confluent/selfservice.py @@ -64,7 +64,7 @@ def handle_request(env, start_response): ncfg['ipv4_netmask'] = netutil.cidr_to_mask(ncfg['prefix']) deployinfo = cfg.get_node_attributes( nodename, ('deployment.*', 'console.method', 'crypted.rootpassword', - 'services.*')) + 'dns.*')) deployinfo = deployinfo.get(nodename, {}) profile = deployinfo.get( 'deployment.pendingprofile', {}).get('value', '') @@ -117,6 +117,8 @@ def handle_request(env, start_response): for dns in deployinfo.get( 'dns.servers', {}).get('value', '').split(','): ncfg['nameservers'].append(dns) + dnsdomain = dedployinfo.get('dns.domain', {}).get('value', None) + ncfg['dnsdomain'] = dnsdomain start_response('200 OK', (('Content-Type', retype),)) yield dumper(ncfg) elif env['PATH_INFO'] == '/self/sshcert':