2018-09-19 13:01:23 +02:00
|
|
|
---
|
|
|
|
# Regression test for https://github.com/ansible/ansible/pull/45700
|
|
|
|
- name: Registering container name
|
|
|
|
set_fact:
|
|
|
|
cname: "{{ cname_prefix ~ '-45700' }}"
|
|
|
|
- name: Registering container name
|
|
|
|
set_fact:
|
2019-05-31 23:47:53 +02:00
|
|
|
cnames: "{{ cnames + [cname] }}"
|
2018-09-19 13:01:23 +02:00
|
|
|
|
|
|
|
- name: Start container
|
|
|
|
docker_container:
|
|
|
|
image: alpine:3.8
|
2018-09-24 11:40:05 +02:00
|
|
|
command: '/bin/sh -c "sleep 10m"'
|
2018-09-19 13:01:23 +02:00
|
|
|
name: "{{ cname }}"
|
|
|
|
state: started
|
|
|
|
|
|
|
|
- name: Stop container with a lot of invalid options
|
|
|
|
docker_container:
|
|
|
|
name: "{{ cname }}"
|
2018-11-16 13:37:12 +01:00
|
|
|
force_kill: yes
|
2018-09-19 13:01:23 +02:00
|
|
|
# Some options with "invalid" values, which would
|
|
|
|
# have to be parsed. The values are "invalid" because
|
|
|
|
# the containers and networks listed here do not exist.
|
|
|
|
# This can happen because the networks are removed
|
|
|
|
# before the container is stopped (see
|
|
|
|
# https://github.com/ansible/ansible/issues/45486).
|
|
|
|
networks:
|
|
|
|
- name: "nonexistant-network-{{ (2**32) | random }}"
|
|
|
|
published_ports:
|
|
|
|
- '1:2'
|
|
|
|
- '3'
|
|
|
|
links:
|
|
|
|
- "nonexistant-container-{{ (2**32) | random }}:test"
|
|
|
|
state: absent
|