Improve CI (#198)

* Use remote temp path, replace remote lookups.

* Copy local files.

* Change docker resource name prefix from ansible-test to ansible-docker-test to avoid collision with ansible-test's containers.

* Fix typos.

* We don't neceessarily have a TTY.

* Use hopefully less collision-likely subnet.

* More collision avoidance.

* More changes.
This commit is contained in:
Felix Fontein
2021-09-08 09:43:35 +02:00
committed by GitHub
parent 451bc0e94e
commit 5a3ce51049
42 changed files with 190 additions and 139 deletions
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_remote_tmp_dir
@@ -1,7 +1,7 @@
---
- name: Create random name prefix
set_fact:
name_prefix: "{{ 'ansible-test-%0x' % ((2**32) | random) }}"
name_prefix: "{{ 'ansible-docker-test-%0x' % ((2**32) | random) }}"
- name: Create image and container list
set_fact:
inames: []
@@ -18,7 +18,7 @@
all_images: "{{ image_names + (images.results | map(attribute='image') | map(attribute='Id') | list) }}"
- name: Create archives
command: docker save {{ item.images | join(' ') }} -o {{ output_dir }}/{{ item.file }}
command: docker save {{ item.images | join(' ') }} -o {{ remote_tmp_dir }}/{{ item.file }}
loop:
- file: archive-1.tar
images: "{{ image_names }}"
@@ -72,7 +72,7 @@
- name: Load all images (IDs)
docker_image_load:
path: "{{ output_dir }}/archive-2.tar"
path: "{{ remote_tmp_dir }}/archive-2.tar"
register: result
- name: Print loaded image names
@@ -87,7 +87,7 @@
- name: Load all images (IDs, should be same result)
docker_image_load:
path: "{{ output_dir }}/archive-2.tar"
path: "{{ remote_tmp_dir }}/archive-2.tar"
register: result_2
- name: Print loaded image names
@@ -110,7 +110,7 @@
- name: Load all images (mixed images and IDs)
docker_image_load:
path: "{{ output_dir }}/archive-3.tar"
path: "{{ remote_tmp_dir }}/archive-3.tar"
register: result
- name: Print loading log
@@ -140,7 +140,7 @@
- name: Load all images (same image twice)
docker_image_load:
path: "{{ output_dir }}/archive-4.tar"
path: "{{ remote_tmp_dir }}/archive-4.tar"
register: result
- name: Print loaded image names
@@ -165,7 +165,7 @@
- name: Load all images (single image by ID)
docker_image_load:
path: "{{ output_dir }}/archive-5.tar"
path: "{{ remote_tmp_dir }}/archive-5.tar"
register: result
- name: Print loaded image names
@@ -200,7 +200,7 @@
- name: Load all images (names)
docker_image_load:
path: "{{ output_dir }}/archive-1.tar"
path: "{{ remote_tmp_dir }}/archive-1.tar"
register: result
- name: Print loaded image names