From d879b2aa99b7c2d3ddb79c2149e2c5bc2c1a1ae2 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Mon, 4 Feb 2019 10:45:01 +1300 Subject: [PATCH] Use ssh in generated inventory for undercloud This switches over to ssh for external deploy tasks, so they are run in the context of the undercloud host instead of inside the mistral-executor container. Change-Id: Iae415339308a93ad49eeb7e4d7e0be2662abf0ee Closes-Bug: #1813832 --- tripleo_common/inventory.py | 2 +- tripleo_common/tests/test_inventory.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tripleo_common/inventory.py b/tripleo_common/inventory.py index db1ec8fcd..2341384bd 100644 --- a/tripleo_common/inventory.py +++ b/tripleo_common/inventory.py @@ -150,7 +150,7 @@ class TripleoInventory(object): 'hosts': self._hosts(['undercloud']), 'vars': { 'ansible_host': 'localhost', - 'ansible_connection': 'local', + 'ansible_ssh_user': self.ansible_ssh_user, 'ansible_python_interpreter': sys.executable, # see https://github.com/ansible/ansible/issues/41808 'ansible_remote_tmp': '/tmp/ansible-${USER}', diff --git a/tripleo_common/tests/test_inventory.py b/tripleo_common/tests/test_inventory.py index 3b920c06d..451bf8267 100644 --- a/tripleo_common/tests/test_inventory.py +++ b/tripleo_common/tests/test_inventory.py @@ -198,7 +198,7 @@ class TestInventory(base.TestCase): 'redis_vip': 'x.x.x.6'}}, 'Undercloud': { 'hosts': ['undercloud'], - 'vars': {'ansible_connection': 'local', + 'vars': {'ansible_ssh_user': 'heat-admin', 'ansible_host': 'localhost', 'ansible_python_interpreter': sys.executable, 'ansible_remote_tmp': '/tmp/ansible-${USER}', @@ -272,7 +272,7 @@ class TestInventory(base.TestCase): 'redis_vip': 'x.x.x.6'}}, 'Undercloud': { 'hosts': ['undercloud'], - 'vars': {'ansible_connection': 'local', + 'vars': {'ansible_ssh_user': 'my-custom-admin', 'ansible_host': 'localhost', 'ansible_python_interpreter': 'foo', 'ansible_remote_tmp': '/tmp/ansible-${USER}', @@ -370,7 +370,7 @@ class TestInventory(base.TestCase): 'sh': {'children': {'CustomRole': {}}, 'vars': {'ansible_ssh_user': 'heat-admin'}}, 'Undercloud': {'hosts': {'undercloud': {}}, - 'vars': {'ansible_connection': 'local', + 'vars': {'ansible_ssh_user': 'heat-admin', 'ansible_host': 'localhost', 'ansible_python_interpreter': sys.executable,