summaryrefslogtreecommitdiffstats
path: root/utils/src/ooinstall/openshift_ansible.py
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-01-12 14:20:14 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2016-01-12 14:20:14 -0500
commit46b9ee3a4bd74a2dd815c0c465bb17c85db90d17 (patch)
treee4bd223820621c1a3f39fd2ba4c76b688ebf48a5 /utils/src/ooinstall/openshift_ansible.py
parent920fdaab001e27e9064a939eba6b3082c7230f43 (diff)
parent81a8df590d40bb4fcc8902e0f9fb6a0406a0fa37 (diff)
downloadopenshift-46b9ee3a4bd74a2dd815c0c465bb17c85db90d17.tar.gz
openshift-46b9ee3a4bd74a2dd815c0c465bb17c85db90d17.tar.bz2
openshift-46b9ee3a4bd74a2dd815c0c465bb17c85db90d17.tar.xz
openshift-46b9ee3a4bd74a2dd815c0c465bb17c85db90d17.zip
Merge pull request #1143 from smunilla/new_nodes
atomic-openshift-installer: Populate new_nodes group
Diffstat (limited to 'utils/src/ooinstall/openshift_ansible.py')
-rw-r--r--utils/src/ooinstall/openshift_ansible.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py
index fd2cd7fbd..20401f812 100644
--- a/utils/src/ooinstall/openshift_ansible.py
+++ b/utils/src/ooinstall/openshift_ansible.py
@@ -19,13 +19,15 @@ def generate_inventory(hosts):
global CFG
masters = [host for host in hosts if host.master]
nodes = [host for host in hosts if host.node]
+ new_nodes = [host for host in hosts if host.node and host.new_host]
proxy = determine_proxy_configuration(hosts)
multiple_masters = len(masters) > 1
+ scaleup = len(new_nodes) > 0
base_inventory_path = CFG.settings['ansible_inventory_path']
base_inventory = open(base_inventory_path, 'w')
- write_inventory_children(base_inventory, multiple_masters, proxy)
+ write_inventory_children(base_inventory, multiple_masters, proxy, scaleup)
write_inventory_vars(base_inventory, multiple_masters, proxy)
@@ -71,6 +73,11 @@ def generate_inventory(hosts):
base_inventory.write('\n[lb]\n')
write_host(proxy, base_inventory)
+ if scaleup:
+ base_inventory.write('\n[new_nodes]\n')
+ for node in new_nodes:
+ write_host(node, base_inventory)
+
base_inventory.close()
return base_inventory_path
@@ -84,12 +91,14 @@ def determine_proxy_configuration(hosts):
return None
-def write_inventory_children(base_inventory, multiple_masters, proxy):
+def write_inventory_children(base_inventory, multiple_masters, proxy, scaleup):
global CFG
base_inventory.write('\n[OSEv3:children]\n')
base_inventory.write('masters\n')
base_inventory.write('nodes\n')
+ if scaleup:
+ base_inventory.write('new_nodes\n')
if multiple_masters:
base_inventory.write('etcd\n')
if not getattr(proxy, 'preconfigured', True):