From d4005f49ed7848aa25463ee48441687e8519ccd5 Mon Sep 17 00:00:00 2001 From: Micah Abbott Date: Thu, 14 Jun 2018 14:41:11 -0400 Subject: [PATCH] run-tree-smoketest: create a tmpdir to use with Ansible The 'smoketest' job was failing while running the sanity test because it was unable to copy a file from the host under test to the host running the playbook. The error message suggested to use a temp directory under `/tmp` as a mitigation. This creates a random temp directory and sets an env var to tell Ansible to use said temp directory. --- centos-ci/run-tree-smoketest | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/centos-ci/run-tree-smoketest b/centos-ci/run-tree-smoketest index 731a33b..025976f 100755 --- a/centos-ci/run-tree-smoketest +++ b/centos-ci/run-tree-smoketest @@ -32,6 +32,25 @@ head=$(vm_cmd ostree rev-parse centos-atomic-host/7/x86_64/devel/continuous) export ANSIBLE_HOST_KEY_CHECKING=False +# The 'smoketest' job was failing while trying to copy files from the host +# under test to the host running Ansible. The following error was observed: +# +# Authentication or permission failure. In some cases, you may have been +# able to authenticate and did not have permissions on the target directory. +# Consider changing the remote tmp path in ansible.cfg to a path rooted +# in "/tmp". Failed command was: ( umask 77 && +# mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1527796579.81-233460530664079 `" && +# echo ansible-tmp-1527796579.81-233460530664079="` +# echo /root/.ansible/tmp/ansible-tmp-1527796579.81-233460530664079 `" ), +# exited with result 1 +# +# In attempt to workaround this, we can create a temporary directory and +# have Ansible use that. See: +# +# https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-local-tmp +# +export ANSIBLE_LOCAL_TEMP=$(mktemp -d) + pass=0 if ansible-playbook -v -i $ip, -u root \ atomic-host-tests/tests/improved-sanity-test/main.yml; then