docker modules: make sure everything works with older docker-py versions (#55258)

* General test improvements.

* Adjust tests to older docker-py versions.

* docker_swarm_server_info: work around problems with older docker-py versions

* Bump minimal docker-py version for options network_filters and disk_usage.

* More general test improvements.

* Correct usage of docker_image.

* Put files into output directory.

* Speed up test.

* Remove old check.
This commit is contained in:
Felix Fontein
2019-04-17 19:50:57 +02:00
committed by ansibot
parent 24b44e1772
commit 12d26eceb1
20 changed files with 119 additions and 40 deletions

View File

@@ -46,21 +46,24 @@
- name: Tag image with alias
docker_image:
source: local
name: "hello-world:latest"
repository: "hello-world:alias"
register: tag_1
- name: Tag image with alias (idempotent)
docker_image:
source: local
name: "hello-world:latest"
repository: "hello-world:alias"
register: tag_2
- name: Tag image with alias (force, still idempotent)
docker_image:
source: local
name: "hello-world:latest"
repository: "hello-world:alias"
force: yes
force_tag: yes
register: tag_3
- assert:
@@ -105,7 +108,8 @@
name: "hello-world:latest"
repository: "{{ registry_address }}/test/hello-world"
push: yes
force: yes
source: local
force_tag: yes
register: push_3
- assert:

View File

@@ -228,7 +228,7 @@
- name: Archive image
docker_image:
name: "hello-world:latest"
archive_path: image.tar
archive_path: "{{ output_dir }}/image.tar"
source: pull
register: archive_image
@@ -241,14 +241,14 @@
- name: load image (changed)
docker_image:
name: "hello-world:latest"
load_path: image.tar
load_path: "{{ output_dir }}/image.tar"
source: load
register: load_image
- name: load image (idempotency)
docker_image:
name: "hello-world:latest"
load_path: image.tar
load_path: "{{ output_dir }}/image.tar"
source: load
register: load_image_1