# Getting notified when awx-operator has ended AWX installation

**URL:** <https://forum.ansible.com/t/getting-notified-when-awx-operator-has-ended-awx-installation/7592>\
**Category:** Get Help\
**Tags:** awx\
**Created:** [August 2, 2024, 10:05am UTC](https://forum.ansible.com/t/getting-notified-when-awx-operator-has-ended-awx-installation/7592 "2024-08-02T10:05:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dangoncalves](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dangoncalves/32/2427_2.png) [@dangoncalves](https://forum.ansible.com/u/dangoncalves)\
**Post date:** [August 2, 2024, 10:05am UTC](https://forum.ansible.com/t/getting-notified-when-awx-operator-has-ended-awx-installation/7592/1 "2024-08-02T10:05:02Z")

</div>

Hello,

I wonder what’s the better way to getting notified when the awx-operator has ended its reconciliation loop (and eventually its state)?

To illustrate my request, here is my use case: I install AWX through the operator, I follow the logs and when the reconciliation loop has successfully ended there is no more log and the play recap state there where no changed tasks, then I can run a job in order to initialize my AWX instance. What I want to achieve is a way to getting notified when I can run my init job automatically.

---

<div class="post-metadata">

**Author:** ![Klaas](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Klaas](https://forum.ansible.com/u/Klaas)\
**Post date:** [August 2, 2024, 12:09pm UTC](https://forum.ansible.com/t/getting-notified-when-awx-operator-has-ended-awx-installation/7592/2 "2024-08-02T12:09:31Z")

</div>

I do two things:

```auto
- name: Wait for {{ awx_instance_name }} pods to be running and that the migration pod has succeeded
  kubernetes.core.k8s_info:
    api_version: v1
    kind: Pod
    namespace: awx
    label_selectors:
      - app.kubernetes.io/part-of = {{ awx_instance_name }}
      - app.kubernetes.io/operator-version = {{ awx_operator_tag }}
  register: _pod_list
  until: _pod_list|json_query('resources[*].status.phase')|unique == ["Succeeded","Running"]
  retries: 20
  delay: 60

- name: Pause play until awx is responding to liveness check
  ansible.builtin.uri:
    url: http://{{ awx_instance_name }}.{{ awx_domain_name }}/api/v2/ping/
    follow_redirects: none
    method: GET
  # This task does not do changes, it should always run, even in check mode
  check_mode: false
  register: _awx_liveness_result
  until: _awx_liveness_result.status == 200
  retries: 60
  delay: 5

```

---

<div class="post-metadata">

**Author:** ![dangoncalves](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dangoncalves/32/2427_2.png) [@dangoncalves](https://forum.ansible.com/u/dangoncalves)\
**Post date:** [August 2, 2024, 1:01pm UTC](https://forum.ansible.com/t/getting-notified-when-awx-operator-has-ended-awx-installation/7592/3 "2024-08-02T13:01:50Z")

</div>

Thanks a lot for your answer. I already thought about looking to the liveness check, but the fact is that AWX’s liveness check passes before operator has ended his reconciliation loop.

---

<div class="post-metadata">

**Author:** ![Klaas](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Klaas](https://forum.ansible.com/u/Klaas)\
**Post date:** [August 2, 2024, 1:13pm UTC](https://forum.ansible.com/t/getting-notified-when-awx-operator-has-ended-awx-installation/7592/4 "2024-08-02T13:13:12Z")

</div>

that’s why I have two tasks 🙂

---

<div class="post-metadata">

**Author:** ![Klaas](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Klaas](https://forum.ansible.com/u/Klaas)\
**Post date:** [August 2, 2024, 1:16pm UTC](https://forum.ansible.com/t/getting-notified-when-awx-operator-has-ended-awx-installation/7592/5 "2024-08-02T13:16:08Z")

</div>

the first task waits for new pods with new version to be in place and for migration pod to be finished, the 2nd task waits for new awx to respond to liveness check, I’ve updated a few times using these checks – but until a few versions ago the migration was not tagged with part-of and operator-version, that only changed 1/2 operator releases ago.

---

<div class="post-metadata">

**Author:** ![dangoncalves](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dangoncalves/32/2427_2.png) [@dangoncalves](https://forum.ansible.com/u/dangoncalves)\
**Post date:** [August 2, 2024, 1:30pm UTC](https://forum.ansible.com/t/getting-notified-when-awx-operator-has-ended-awx-installation/7592/6 "2024-08-02T13:30:27Z")

</div>

I didn’t noticed this behaviour change. Thanks you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [September 1, 2024, 1:31pm UTC](https://forum.ansible.com/t/getting-notified-when-awx-operator-has-ended-awx-installation/7592/7 "2024-09-01T13:31:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
