diff --git a/changelogs/fragments/vanquish-rare-container-bootstrap-failure.yml b/changelogs/fragments/vanquish-rare-container-bootstrap-failure.yml new file mode 100644 index 00000000000..2a207fdefde --- /dev/null +++ b/changelogs/fragments/vanquish-rare-container-bootstrap-failure.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test - Avoid using ``/tmp`` to resolve occasional failures starting tests with the ``--docker`` option. diff --git a/test/lib/ansible_test/_data/setup/docker.sh b/test/lib/ansible_test/_data/setup/docker.sh index c65e8ac5fc2..ea60e1a6f35 100644 --- a/test/lib/ansible_test/_data/setup/docker.sh +++ b/test/lib/ansible_test/_data/setup/docker.sh @@ -6,9 +6,8 @@ set -eu rm -f /usr/sbin/policy-rc.d # Improve prompts on remote host for interactive use. -# shellcheck disable=SC1117 -cat << EOF > ~/.bashrc -alias ls='ls --color=auto' -export PS1='\[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' -cd ~/ansible/ -EOF +# `cat << EOF > ~/.bashrc` flakes sometimes since /tmp may not be ready yet in +# the container. So don't do that +echo "alias ls='ls --color=auto'" > ~/.bashrc +echo "export PS1='\[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" >> ~/.bashrc +echo "cd ~/ansible/" >> ~/.bashrc