tripleo-validations/roles/image_serve/tasks/main.yaml

32 lines
848 B
YAML

---
- name: Ensure we have the httpd config
stat:
path: "{{ container_registry_httpd_config }}"
register: registry_config
- name: Fail early if no httpd config is present
when: not registry_config.stat.exists
fail:
msg: "Unable to find vhost config {{ container_registry_httpd_config }}. Exiting now."
- name: Extract vhost name from httpd config
command: |
awk -F '[ >:]*' '/VirtualHost/ {print $2; exit}' {{ container_registry_httpd_config }}
register: virthost_name
- name: Ensure port is open
wait_for:
port: "{{ container_registry_port }}"
host: "{{ virthost_name.stdout }}"
timeout: 10
- name: Ensure registry does answer
uri:
method: HEAD
url: "http://{{ virthost_name.stdout }}:{{ container_registry_port }}/v2/index.json"
status_code:
- 200
- 204
- 301
- 302