# How do I wait on operator deployment?

**URL:** <https://forum.ansible.com/t/how-do-i-wait-on-operator-deployment/35300>\
**Category:** AWX Project\
**Tags:** kubernetes, awx\
**Created:** [June 7, 2021, 8:25pm UTC](https://forum.ansible.com/t/how-do-i-wait-on-operator-deployment/35300 "2021-06-07T20:25:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon\_Ellis](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@Brandon\_Ellis](https://forum.ansible.com/u/Brandon_Ellis)\
**Post date:** [June 7, 2021, 8:25pm UTC](https://forum.ansible.com/t/how-do-i-wait-on-operator-deployment/35300/1 "2021-06-07T20:25:53Z")

</div>

The install instructions say:

“After a few minutes, the new AWX instance will be deployed. One can look at the operator pod logs in order to know where the installation process is at. This can be done by running the following command: kubectl logs -f deployments/awx-operator.”

But let’s say I want to automate a deployment. I can’t just keep spamming the “kubernetes logs” command in an automated deployment.

How do I wait for the deployment to finish?

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 7, 2021, 8:30pm UTC](https://forum.ansible.com/t/how-do-i-wait-on-operator-deployment/35300/2 "2021-06-07T20:30:08Z")

</div>

Can you test the url for A particular output in the text using get-url?

---

<div class="post-metadata">

**Author:** ![Brandon\_Ellis](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@Brandon\_Ellis](https://forum.ansible.com/u/Brandon_Ellis)\
**Post date:** [June 7, 2021, 8:41pm UTC](https://forum.ansible.com/t/how-do-i-wait-on-operator-deployment/35300/3 "2021-06-07T20:41:35Z")

</div>

I probably can. However, it would be ideal to use the actual kubernetes state over URL reachability

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 7, 2021, 8:44pm UTC](https://forum.ansible.com/t/how-do-i-wait-on-operator-deployment/35300/4 "2021-06-07T20:44:26Z")

</div>

If you are familiar with python then yoy can write a custom module that can loop through the kubernetes logs or other logic and then have that executed in an ansible way

---

<div class="post-metadata">

**Author:** ![Brandon\_Ellis](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@Brandon\_Ellis](https://forum.ansible.com/u/Brandon_Ellis)\
**Post date:** [June 7, 2021, 9:08pm UTC](https://forum.ansible.com/t/how-do-i-wait-on-operator-deployment/35300/5 "2021-06-07T21:08:24Z")

</div>

But wait, doesn’t the Status.Conditions.Reason property of the AWX resource change to “Successful” when the entire thing is deployed? Wouldn’t that be a much better thing to operate on?

 ![kubernetes condition.png](https://us1.discourse-cdn.com/ansible/original/2X/3/3d719ac49b32fcb981ad414871cd65acbd19abfc.png)

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 7, 2021, 9:10pm UTC](https://forum.ansible.com/t/how-do-i-wait-on-operator-deployment/35300/6 "2021-06-07T21:10:49Z")

</div>

As I said. Perhaps a custom python ansible task would suit you which will account for :  
or ‘other logic’. If you know python you can write logic to accommodate for exactly that

> **(attachments)**
>
> ![kubernetes condition.png](https://us1.discourse-cdn.com/ansible/original/2X/3/3d719ac49b32fcb981ad414871cd65acbd19abfc.png)
