summaryrefslogtreecommitdiffstats
path: root/utils/src/ooinstall
diff options
context:
space:
mode:
authorSamuel Munilla <smunilla@redhat.com>2016-08-03 11:04:46 -0400
committerSamuel Munilla <smunilla@redhat.com>2016-08-03 13:33:08 -0400
commitbb7de7e23654a7611c5be77dc6565e10435260fe (patch)
tree78ebd2f9e48b3cd30b04cc87e0c8b6484940e94c /utils/src/ooinstall
parent5c681f6baa64a69207f286ff449bc446bf5f0eff (diff)
downloadopenshift-bb7de7e23654a7611c5be77dc6565e10435260fe.tar.gz
openshift-bb7de7e23654a7611c5be77dc6565e10435260fe.tar.bz2
openshift-bb7de7e23654a7611c5be77dc6565e10435260fe.tar.xz
openshift-bb7de7e23654a7611c5be77dc6565e10435260fe.zip
a-o-i: Allow Arbitrary Deployment Variables
This allows for arbitrary ansible variables to be set under the 'deployment' header of the installer config file.
Diffstat (limited to 'utils/src/ooinstall')
-rw-r--r--utils/src/ooinstall/oo_config.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/utils/src/ooinstall/oo_config.py b/utils/src/ooinstall/oo_config.py
index e37892c9b..69ad2b4c5 100644
--- a/utils/src/ooinstall/oo_config.py
+++ b/utils/src/ooinstall/oo_config.py
@@ -17,11 +17,9 @@ CONFIG_PERSIST_SETTINGS = [
'variant_version',
]
-DEPLOYMENT_PERSIST_SETTINGS = [
- 'master_routingconfig_subdomain',
- 'proxy_http',
- 'proxy_https',
- 'proxy_exclude_hosts',
+DEPLOYMENT_VARIABLES_BLACKLIST = [
+ 'hosts',
+ 'roles',
]
DEFAULT_REQUIRED_FACTS = ['ip', 'public_ip', 'hostname', 'public_hostname']
@@ -191,10 +189,11 @@ class OOConfig(object):
except KeyError:
continue
- for setting in DEPLOYMENT_PERSIST_SETTINGS:
+ for setting in loaded_config['deployment']:
try:
- self.deployment.variables[setting] = \
- str(loaded_config['deployment'][setting])
+ if setting not in DEPLOYMENT_VARIABLES_BLACKLIST:
+ self.deployment.variables[setting] = \
+ str(loaded_config['deployment'][setting])
except KeyError:
continue
@@ -306,21 +305,20 @@ class OOConfig(object):
if setting in self.settings and self.settings[setting]:
p_settings[setting] = self.settings[setting]
-
p_settings['deployment'] = {}
p_settings['deployment']['hosts'] = []
p_settings['deployment']['roles'] = {}
- for setting in DEPLOYMENT_PERSIST_SETTINGS:
- if setting in self.deployment.variables:
- p_settings['deployment'][setting] = self.deployment.variables[setting]
-
for host in self.deployment.hosts:
p_settings['deployment']['hosts'].append(host.to_dict())
for name, role in self.deployment.roles.iteritems():
p_settings['deployment']['roles'][name] = role.variables
+ for setting in self.deployment.variables:
+ if setting not in DEPLOYMENT_VARIABLES_BLACKLIST:
+ p_settings['deployment'][setting] = self.deployment.variables[setting]
+
try:
p_settings['variant'] = self.settings['variant']
p_settings['variant_version'] = self.settings['variant_version']