mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-16 11:58:43 +00:00
* Try adding EE support. * Use GHA instead of AZP for EE tests. * Update changelog fragment, extend tests. * Disable current_container_facts test. * Increase verbosity. * 2.9 compatibility. * Use docker instead of podman for building EE and running tests in it. * Output some more information (helpful for debugging). * Fix GHA handling for current_container_facts. * Try to fix permissions.
35 lines
906 B
YAML
35 lines
906 B
YAML
---
|
|
# Create random name prefix (for containers, networks, ...)
|
|
- name: Create random container name prefix
|
|
set_fact:
|
|
cname_prefix: "{{ 'ansible-docker-test-%0x' % ((2**32) | random) }}"
|
|
|
|
- name: Create project and container names
|
|
set_fact:
|
|
pname: "{{ cname_prefix }}"
|
|
cname: "{{ cname_prefix }}-hi"
|
|
|
|
- name: Define service
|
|
set_fact:
|
|
test_service: |
|
|
version: '3'
|
|
services:
|
|
{{ cname }}:
|
|
image: "{{ docker_test_image_alpine }}"
|
|
command: '/bin/sh -c "sleep 10m"'
|
|
stop_grace_period: 1s
|
|
|
|
- name: Present
|
|
community.docker.docker_compose:
|
|
project_name: "{{ pname }}"
|
|
state: present
|
|
remove_orphans: true
|
|
definition: "{{ test_service | from_yaml }}"
|
|
|
|
- name: Absent
|
|
community.docker.docker_compose:
|
|
project_name: "{{ pname }}"
|
|
state: absent
|
|
remove_orphans: true
|
|
definition: "{{ test_service | from_yaml }}"
|