From 9e678eeb8e22d90c4ee3e7775fb93d9b93b1b090 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 22 Mar 2016 12:14:04 -0500 Subject: [PATCH] Don't set the host's name as UUID It looks like we solved the duplicate server problem twice in conflicting ways. Using uuid in the inventory is not needed, bcause we're making a specific inventory for the ansible commands and avoiding the OpenStack inventory. So the ansible run has no idea of any other servers other than the one we're making right now. With that, we can use name as the hostname rather than UUID. Story: 2000520 Change-Id: Idb967e10fc00471923077e4e9caa32fdb4c1cc78 --- launch/launch-node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launch/launch-node.py b/launch/launch-node.py index 523a5c726b..d8bb5d46a2 100644 --- a/launch/launch-node.py +++ b/launch/launch-node.py @@ -94,12 +94,12 @@ def bootstrap_server(server, key, name, volume, keep): # Write out inventory inventory_file = tempfile.NamedTemporaryFile(delete=not keep) inventory_file.write("{host} ansible_host={ip} ansible_user=root".format( - host=server.id, ip=server.interface_ip)) + host=name, ip=server.interface_ip)) inventory_file.flush() ansible_cmd = [ 'ansible-playbook', - '-i', inventory_file.name, '-l', server.id, + '-i', inventory_file.name, '-l', name, '--private-key={key}'.format(key=key_file.name), "--ssh-common-args='-o StrictHostKeyChecking=no'", '-e', 'target={id}'.format(id=server.id),