From eb6c3c2f1ab87396d68fb83875a669400d2230e2 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 8 Mar 2019 17:53:28 +0000 Subject: [PATCH] Add global inventory to launch_node Passing the -i to the jobdir means we're overriding the inventory. This means variables that come from the /etc/ansible vars, like sysadmins, are missing. Add the global inventory to the command line for ansible-playbook. We have --limit specified from '-l' - so we should still only run on the host in question. Change-Id: Ia67e65d25a1d961b619aa445303015fd577dee57 --- launch/launch-node.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/launch/launch-node.py b/launch/launch-node.py index d52e1dae14..bf1d31d9ba 100755 --- a/launch/launch-node.py +++ b/launch/launch-node.py @@ -170,9 +170,15 @@ def bootstrap_server(server, key, name, volume_device, keep, t.daemon = True t.start() + inventory_list = ','.join([ + jobdir.inventory_root, + '/opt/system-config/inventory/openstack.yaml', + '/opt/system-config/inventory/groups.yaml', + '/opt/system-config/inventory/emergency.yaml', + ]) ansible_cmd = [ 'ansible-playbook', - '-i', jobdir.inventory_root, '-l', name, + '-i', inventory_list, '-l', name, '--private-key={key}'.format(key=jobdir.key), "--ssh-common-args='-o StrictHostKeyChecking=no'", '-e', 'target={name}'.format(name=name),