Skip to content

Commit

Permalink
Use new awx default queue name
Browse files Browse the repository at this point in the history
  • Loading branch information
Spredzy committed Jun 7, 2021
1 parent 5dc31e6 commit 2f92f61
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions roles/installer/tasks/initialize_django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,38 @@
register: cdo
changed_when: "'added' in cdo.stdout"
when: create_preload_data | bool

- name: Register the instance in the database
k8s_exec:
namespace: "{{ meta.namespace }}"
pod: "{{ tower_pod_name }}"
container: "{{ meta.name }}-task"
command: >-
bash -c "awx-manage provision_instance --hostname={{ tower_pod_name }}"
- name: Check if legacy queue is present
k8s_exec:
namespace: "{{ meta.namespace }}"
pod: "{{ tower_pod_name }}"
container: "{{ meta.name }}-task"
command: >-
bash -c "awx-manage list_instances | grep '^\[tower capacity=[0-9]*\]'"
register: legacy_queue
changed_when: false

- name: Unregister legacy queue
k8s_exec:
namespace: "{{ meta.namespace }}"
pod: "{{ tower_pod_name }}"
container: "{{ meta.name }}-task"
command: >-
bash -c "awx-manage unregister_queue --queuename=tower"
when: "'[tower capacity=' in legacy_queue.stdout"

- name: Register new queue name
k8s_exec:
namespace: "{{ meta.namespace }}"
pod: "{{ tower_pod_name }}"
container: "{{ meta.name }}-task"
command: >-
bash -c "awx-manager register_queue --queuename=default --instance_percent=100"

0 comments on commit 2f92f61

Please sign in to comment.