diff --git a/tripleo_common/actions/ansible.py b/tripleo_common/actions/ansible.py index 370e5ced7..55111c2d2 100644 --- a/tripleo_common/actions/ansible.py +++ b/tripleo_common/actions/ansible.py @@ -221,6 +221,7 @@ class AnsibleAction(actions.Action): self.ssh_private_key) env_variables = { 'HOME': self.work_dir, + 'ANSIBLE_LOCAL_TEMP': self.work_dir, 'ANSIBLE_CONFIG': ansible_config_path } @@ -482,6 +483,7 @@ class AnsiblePlaybookAction(base.TripleOAction): self.ssh_private_key) env_variables = { 'HOME': self.work_dir, + 'ANSIBLE_LOCAL_TEMP': self.work_dir, 'ANSIBLE_CONFIG': ansible_config_path, } diff --git a/tripleo_common/inventory.py b/tripleo_common/inventory.py index ff1faf640..6335fccee 100644 --- a/tripleo_common/inventory.py +++ b/tripleo_common/inventory.py @@ -159,6 +159,8 @@ class TripleoInventory(object): 'vars': { 'ansible_host': 'localhost', 'ansible_connection': 'local', + # see https://github.com/ansible/ansible/issues/41808 + 'ansible_remote_tmp': '/tmp/ansible-${USER}', 'auth_url': self.auth_url, 'cacert': self.cacert, 'os_auth_token': diff --git a/tripleo_common/tests/actions/test_ansible.py b/tripleo_common/tests/actions/test_ansible.py index 628520f6a..c5b0fe81e 100644 --- a/tripleo_common/tests/actions/test_ansible.py +++ b/tripleo_common/tests/actions/test_ansible.py @@ -55,6 +55,7 @@ class AnsibleActionTest(base.TestCase): env = { 'HOME': action.work_dir, + 'ANSIBLE_LOCAL_TEMP': action.work_dir, 'ANSIBLE_CONFIG': ansible_config_path } @@ -105,6 +106,7 @@ class AnsiblePlaybookActionTest(base.TestCase): pb = os.path.join(action.work_dir, 'playbook.yaml') env = { 'HOME': action.work_dir, + 'ANSIBLE_LOCAL_TEMP': action.work_dir, 'ANSIBLE_CONFIG': ansible_config_path, 'ANSIBLE_CALLBACK_WHITELIST': 'profile_tasks', 'PROFILE_TASKS_TASK_OUTPUT_LIMIT': '0', diff --git a/tripleo_common/tests/test_inventory.py b/tripleo_common/tests/test_inventory.py index d16cf46fe..c673ad018 100644 --- a/tripleo_common/tests/test_inventory.py +++ b/tripleo_common/tests/test_inventory.py @@ -213,6 +213,7 @@ class TestInventory(base.TestCase): 'hosts': ['undercloud'], 'vars': {'ansible_connection': 'local', 'ansible_host': 'localhost', + 'ansible_remote_tmp': '/tmp/ansible-${USER}', 'auth_url': 'xyz://keystone.local', 'cacert': 'acacert', 'os_auth_token': 'atoken', @@ -281,6 +282,7 @@ class TestInventory(base.TestCase): 'hosts': ['undercloud'], 'vars': {'ansible_connection': 'local', 'ansible_host': 'localhost', + 'ansible_remote_tmp': '/tmp/ansible-${USER}', 'auth_url': 'xyz://keystone.local', 'cacert': 'acacert', 'os_auth_token': @@ -377,6 +379,8 @@ class TestInventory(base.TestCase): 'Undercloud': {'hosts': {'undercloud': {}}, 'vars': {'ansible_connection': 'local', 'ansible_host': 'localhost', + 'ansible_remote_tmp': + '/tmp/ansible-${USER}', 'auth_url': 'xyz://keystone.local', 'cacert': 'acacert', 'os_auth_token': 'atoken',