mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Use FQCNs. (#1180)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
gather_facts: true
|
||||
tasks:
|
||||
- name: remove docker containers
|
||||
docker_container:
|
||||
community.docker.docker_container:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
force_kill: true
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
|
||||
tasks:
|
||||
- name: Setup docker
|
||||
import_role:
|
||||
ansible.builtin.import_role:
|
||||
name: setup_docker
|
||||
|
||||
- name: Setup Docker Python deps
|
||||
import_role:
|
||||
ansible.builtin.import_role:
|
||||
name: setup_docker_python_deps
|
||||
|
||||
- name: Start containers
|
||||
docker_container:
|
||||
community.docker.docker_container:
|
||||
name: "{{ item.name }}"
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
state: started
|
||||
|
||||
+4
-4
@@ -8,10 +8,10 @@
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Show all groups
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: groups
|
||||
- name: Make sure that the default groups are there, but no others
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- groups.all | length >= 2
|
||||
- groups.ungrouped | length >= 2
|
||||
@@ -26,11 +26,11 @@
|
||||
- inventory_hostname.startswith('ansible-docker-test-docker-inventory-container-')
|
||||
block:
|
||||
- name: Run raw command
|
||||
raw: ls /
|
||||
ansible.builtin.raw: ls /
|
||||
register: output
|
||||
|
||||
- name: Check whether we have some directories we expect in the output
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "'bin' in output.stdout_lines"
|
||||
- "'dev' in output.stdout_lines"
|
||||
|
||||
+6
-6
@@ -8,12 +8,12 @@
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Show all groups
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: groups
|
||||
- name: Load variables
|
||||
include_vars: ../../setup_docker/vars/main.yml
|
||||
ansible.builtin.include_vars: ../../setup_docker/vars/main.yml
|
||||
- name: Make sure that the expected groups are there
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- groups.all | length >= 2
|
||||
- groups.ungrouped | length >= 0
|
||||
@@ -36,10 +36,10 @@
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Show all variables
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: hostvars[inventory_hostname]
|
||||
- name: Make sure SSH is set up
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- ansible_ssh_host == '1.2.3.4'
|
||||
- ansible_ssh_port == docker_networksettings.Ports['22/tcp'][0].HostPort
|
||||
@@ -48,7 +48,7 @@
|
||||
# will be other containers.
|
||||
- inventory_hostname.startswith('ansible-docker-test-docker-inventory-container-')
|
||||
- name: Write labels into file
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
dest: "/tmp/{{ inventory_hostname }}-labels.txt"
|
||||
content: |-
|
||||
{{ docker_config.Labels }}
|
||||
|
||||
Reference in New Issue
Block a user