Skip to content

Instantly share code, notes, and snippets.

@zeitounator
Created December 1, 2025 15:53
Show Gist options
  • Select an option

  • Save zeitounator/6e1cf369f542a522e15d16582bed259b to your computer and use it in GitHub Desktop.

Select an option

Save zeitounator/6e1cf369f542a522e15d16582bed259b to your computer and use it in GitHub Desktop.
- name: "get status?"
ansible.builtin.uri:
url: "{{item}}"
method: GET
# 200 if initialized, unsealed, and active
# 429 if unsealed and standby
# 472 if data recovery mode replication secondary and active
# 473 if performance standby
# 501 if not initialized
# 503 if sealed
status_code: "{{ url_http_status.keys() | list }}"
# body_format: json
register: check_result
retries: 5
until: check_result is succeeded
delay: 2
changed_when: false
check_mode: false
loop:
- https://url1
- https://url2
- https://url3
- name: Debug status
ansible.builtin.debug:
msg: "instance {{ item.item }} is {{ url_http_status[item.status | string] }}"
loop: "{{ check_result.results }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment