mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
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:
@@ -7,7 +7,7 @@
|
||||
# Create random name prefix (for containers, networks, ...)
|
||||
- name: Create random container name prefix
|
||||
set_fact:
|
||||
cname_prefix: "{{ 'ansible-test-%0x' % ((2**32) | random) }}"
|
||||
cname_prefix: "{{ 'ansible-docker-test-%0x' % ((2**32) | random) }}"
|
||||
cnames: []
|
||||
dnetworks: []
|
||||
|
||||
|
||||
@@ -1607,13 +1607,18 @@
|
||||
## env_file #########################################################
|
||||
####################################################################
|
||||
|
||||
- name: Copy env-file
|
||||
copy:
|
||||
src: env-file
|
||||
dest: "{{ remote_tmp_dir }}/env-file"
|
||||
|
||||
- name: env_file
|
||||
docker_container:
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
env_file: "{{ role_path }}/files/env-file"
|
||||
env_file: "{{ remote_tmp_dir }}/env-file"
|
||||
register: env_file_1
|
||||
|
||||
- name: env_file (idempotency)
|
||||
@@ -1622,7 +1627,7 @@
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
env_file: "{{ role_path }}/files/env-file"
|
||||
env_file: "{{ remote_tmp_dir }}/env-file"
|
||||
register: env_file_2
|
||||
|
||||
- name: cleanup
|
||||
|
||||
Reference in New Issue
Block a user