Skip to content

Commit

Permalink
run-tree-smoketest: create a tmpdir to use with Ansible
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
miabbott committed Jun 14, 2018
1 parent afc653b commit d4005f4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions centos-ci/run-tree-smoketest
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d4005f4

Please sign in to comment.