25 lines
817 B
YAML

---
- name: Gather service facts
ansible.builtin.service_facts:
- name: Assert OpenApply service is running
ansible.builtin.assert:
that:
- "ansible_facts.services[openapply_app_service_name + '.service'] is defined"
- "ansible_facts.services[openapply_app_service_name + '.service'].state == 'running'"
fail_msg: "OpenApply systemd service is not running."
- name: Wait for OpenApply port to become reachable
ansible.builtin.wait_for:
host: 127.0.0.1
port: "{{ openapply_app_service_port }}"
timeout: 120
- name: Validate HTTP response from OpenApply endpoint
ansible.builtin.uri:
url: "http://127.0.0.1:{{ openapply_app_service_port }}/"
method: GET
status_code: "{{ openapply_app_verify_status_codes }}"
register: openapply_http_probe
changed_when: false