diff options
author | Samuel Munilla <smunilla@redhat.com> | 2016-08-11 15:04:33 -0400 |
---|---|---|
committer | Samuel Munilla <smunilla@redhat.com> | 2016-08-11 15:04:43 -0400 |
commit | c2074c0404131c23045fb2ecf6afa71a187fe9c9 (patch) | |
tree | 754ed730f5b0f79fc0b9d9fe567af746b21675a2 | |
parent | 522cccbc7fd119a182a44af8fb2c0959d919a093 (diff) | |
download | openshift-c2074c0404131c23045fb2ecf6afa71a187fe9c9.tar.gz openshift-c2074c0404131c23045fb2ecf6afa71a187fe9c9.tar.bz2 openshift-c2074c0404131c23045fb2ecf6afa71a187fe9c9.tar.xz openshift-c2074c0404131c23045fb2ecf6afa71a187fe9c9.zip |
a-o-i: Automatically Label Nodes as Infra
In interactive mode, automatically label nodes as infrastructure nodes. Two cases are covered:
1) If all nodes are masters, all hosts are labeled infra
2) If dedicated nodes are defined, the first two (or one) nodes are labeled as infra
-rw-r--r-- | utils/src/ooinstall/cli_installer.py | 11 |
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 |