After a docker failure on a recent job I noticed a single file called
"Got" in the container logs directory; turns out this had tried to
parse the error message "Got permission denied while trying to connect
to the Docker daemon socket ..." as containers.
We don't want this to fail the job hence the ignores here. However,
we shouldn't try to collect any logs if listing the containers fails.
Move creating the directory first as that is safe.
Change-Id: I41db956964f695cfcc15e30cab8cd4f8c31d3706
We have to be careful about avoiding outer loop loop_var conflicts in
ansible. Because the zuul-jobs roles are meant to be reconsumed
elsewhere we should not use 'item' loopvars and instead set them to
something a bit more unique.
We use a zj_ prefix to try and be unique to this repo and document this
convention.
Change-Id: I20b9327a914890e9eafcb2b36dc8c23fb472bc8f
The default loop variable 'item' cannot be nested. Because roles like
collect-container-logs may be called from higher level loops that use
'item' we override the loop control var to a name that should be unique.
This should probably be done to all of the other roles in zuul-jobs too.
Change-Id: I2f647596dd40c662aa7447e3d3c8844a77c6b109
We use this in a few different places and it's really useful
to collect all the logs of all containers.
Change-Id: Idc46a47f444bf48cd040f4f9724f3a6ee8bc8f8e