summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-08-11 17:38:57 -0400
committerGitHub <noreply@github.com>2016-08-11 17:38:57 -0400
commitadd6fd9fac9ea32dd87a97173abf3576e8d49a3b (patch)
tree9682b92051560826adfbf9555427a9a90c8d5e83 /utils
parent2fcfbb350a888dfeb82913f2e043bf2fea760cd6 (diff)
parentc2074c0404131c23045fb2ecf6afa71a187fe9c9 (diff)
downloadopenshift-add6fd9fac9ea32dd87a97173abf3576e8d49a3b.tar.gz
openshift-add6fd9fac9ea32dd87a97173abf3576e8d49a3b.tar.bz2
openshift-add6fd9fac9ea32dd87a97173abf3576e8d49a3b.tar.xz
openshift-add6fd9fac9ea32dd87a97173abf3576e8d49a3b.zip
Merge pull request #2286 from smunilla/label_infra_nodes
a-o-i: Automatically Label Nodes as Infra
Diffstat (limited to 'utils')
-rw-r--r--utils/src/ooinstall/cli_installer.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py
index bc15e41d5..2975592a1 100644
--- a/utils/src/ooinstall/cli_installer.py
+++ b/utils/src/ooinstall/cli_installer.py
@@ -613,6 +613,7 @@ https://docs.openshift.com/enterprise/latest/admin_guide/install/prerequisites.h
if not oo_cfg.deployment.hosts:
oo_cfg.deployment.hosts, roles = collect_hosts(oo_cfg)
+ set_infra_nodes(oo_cfg.deployment.hosts)
for role in roles:
oo_cfg.deployment.roles[role] = Role(name=role, variables={})
@@ -757,6 +758,16 @@ def get_hosts_to_run_on(oo_cfg, callback_facts, unattended, force, verbose):
return hosts_to_run_on, callback_facts
+def set_infra_nodes(hosts):
+ if all(host.is_master() for host in hosts):
+ infra_list = hosts
+ else:
+ nodes_list = [host for host in hosts if host.is_node()]
+ infra_list = nodes_list[:2]
+
+ for host in infra_list:
+ host.node_labels = "{'region': 'infra'}"
+
@click.group()
@click.pass_context