mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Wait for instance ready in molecule test (#1901)
Sometimes a job is launched through the web api before the instance is in a ready state. This throws a 500 internal server error, causing CI to fail. Adds a task to query the instances endpoint and check that at least one control node is in a ready state. Signed-off-by: Seth Foster <fosterbseth@gmail.com>
This commit is contained in:
@@ -127,6 +127,17 @@
|
||||
name: example-awx-admin-password
|
||||
register: admin_pw_secret
|
||||
|
||||
- name: Wait for instance to be ready
|
||||
uri:
|
||||
url: "http://localhost/awx/api/v2/instances/?node_type=control&node_state=ready"
|
||||
user: admin
|
||||
password: "{{ admin_pw_secret.resources[0].data.password | b64decode }}"
|
||||
force_basic_auth: yes
|
||||
register: instances
|
||||
until: instances['json']['count'] | int > 0
|
||||
retries: 20
|
||||
delay: 2
|
||||
|
||||
- name: Validate demo job launch
|
||||
block:
|
||||
- name: Launch Demo Job Template
|
||||
|
||||
Reference in New Issue
Block a user