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
This commit is contained in:
		@@ -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),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user