mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-15 09:23:06 -06:00
first pass at incorporating mesh setup/config
This commit is contained in:
45
roles/bitbucket_mesh_config/tasks/mesh_node_report.yml
Normal file
45
roles/bitbucket_mesh_config/tasks/mesh_node_report.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
# create a report on existing mesh nodes
|
||||
|
||||
- block:
|
||||
- name: try calling the server to get a list of the mesh nodes
|
||||
ansible.builtin.uri:
|
||||
url: '{{ atl_proxy_name }}/rest/api/latest/admin/git/mesh/nodes'
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: 'application/json'
|
||||
Accept: 'application/json'
|
||||
Authorization: 'Basic {{ mesh_basic_auth }}'
|
||||
timeout: 60
|
||||
register: mesh_nodes_report
|
||||
retries: 5
|
||||
delay: 10
|
||||
no_log: True # http headers contain auth strings
|
||||
|
||||
- name: set bitbucket dc cluster available fact
|
||||
ansible.builtin.set_fact:
|
||||
bitbucket_cluster_available: true
|
||||
|
||||
- name: print out the mesh_nodes_report
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ mesh_nodes_report.json }}"
|
||||
when:
|
||||
- mesh_nodes_report.status == 200
|
||||
|
||||
- name: set mesh_nodenames_list
|
||||
ansible.builtin.set_fact:
|
||||
mesh_nodenames_list: "{{ mesh_nodes_report | json_query('json[*].name') }}"
|
||||
when: mesh_nodes_report.status == 200
|
||||
|
||||
- name: print out the mesh_nodenames_list
|
||||
ansible.builtin.debug:
|
||||
var: mesh_nodenames_list
|
||||
when: mesh_nodes_report.status == 200
|
||||
|
||||
rescue:
|
||||
- name: set bitbucket dc cluster available fact
|
||||
ansible.builtin.set_fact:
|
||||
bitbucket_cluster_available: false
|
||||
|
||||
- name: log a message about bb cluster unavailable
|
||||
ansible.builtin.debug:
|
||||
msg: "Bitbucket DC cluster not currently available."
|
||||
Reference in New Issue
Block a user