Files
tripleo-validations/roles/containerized_undercloud_docker/tasks/main.yml
Cédric Jeanneret ceb0f75182 Replace all references to the old role name
This change replaces all of the roles references in our various files with the
new role name. This is being done because Ansible no longer allows hyphens in
role names.

TODO: (gchamoul) Remove healthcheck-service-status once this patch is
merged. Tripleo Jobs are RED due to THT trying to execute this
validation as inflight one but it has been renamed healthcheck_service_status.

Co-Authored-by: Gael Chamoulaud <gchamoul@redhat.com>
Change-Id: I19bb587ece403f86ddd0bbe174c282326500cfd3
2020-01-23 17:25:43 +01:00

31 lines
1015 B
YAML

---
- name: gather docker facts
docker_facts:
container_filter: status=running
become: true
- name: compare running containers to list
set_fact:
container_difference: "{{ running_containers | difference(docker.containers_filtered | map(attribute='name') | list) }}"
- block:
- name: check appropriate running containers against list - if FAILED, check next task
assert:
that: "{{ container_difference | length == 0 }}"
rescue:
- name: following containers found to be NOT running
debug:
var: container_difference
- name: check appropriate ports are listening
wait_for:
host: "{{ listening_ip }}"
port: "{{ item.port | default(item) }}"
search_regex: "{{ item.search_regex | default(omit) }}"
state: started # Port should be open
delay: 0 # No wait before first check (sec)
timeout: 3 # Stop checking after timeout (sec)
ignore_errors: true
loop: "{{ open_ports }}"
when: ctlplane_ip is defined