Skip to content

Commit

Permalink
run-tree-smoketest: configure remote temp directory
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 an `ansible.cfg` in the current directory with the
`remote_tmp` configured.
  • Loading branch information
miabbott committed Jun 19, 2018
1 parent afc653b commit 0fe9a55
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions centos-ci/run-tree-smoketest
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@ 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
#
# Unfortunately, there doesn't seem to be an environment variable to configure
# the remote temp directory, so we'll create an `ansible.cfg` file to use
# for the sanity test. As long as it lives in the current directory,
# Ansible should pick it up and use it.
#
# https://davesnigier.com/changing-ansible-temporary-directory/
cat <<EOF > ./ansible.cfg
remote_tmp = /tmp/.ansible-${USER}/tmp/
EOF

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 0fe9a55

Please sign in to comment.