mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 00:13:09 -06:00
55 lines
1.8 KiB
YAML
55 lines
1.8 KiB
YAML
---
|
|
# Handlers are executed in the order they are defined in the handlers section, not in the order listed in the notify statement.
|
|
|
|
- name: Wait for Mesh to become available
|
|
ansible.builtin.wait_for:
|
|
port: "{{ mesh_node_port }}"
|
|
timeout: 300
|
|
delegate_to: localhost
|
|
become: false
|
|
|
|
- name: Register New Mesh Node
|
|
ansible.builtin.uri:
|
|
url: '{{ atl_proxy_name }}/rest/api/latest/admin/git/mesh/nodes'
|
|
method: POST
|
|
headers:
|
|
Content-Type: 'application/json'
|
|
Accept: 'application/json'
|
|
Authorization: 'Basic {{ mesh_basic_auth }}'
|
|
timeout: 60
|
|
body_format: json
|
|
body:
|
|
name: "{{ mesh_node_name }}"
|
|
rpcUrl: "{{ mesh_node_scheme }}://{{ mesh_node_name }}.{{ atl_aws_stack_name }}-{{ ansible_ec2_placement_region }}.{{ atl_hostedzone }}:{{ mesh_node_port }}"
|
|
register: register_mesh_node_result
|
|
until: register_mesh_node_result is not failed
|
|
retries: 5
|
|
delay: 30
|
|
no_log: True
|
|
|
|
- name: Update Existing Mesh Node
|
|
ansible.builtin.uri:
|
|
url: '{{ atl_proxy_name }}/rest/api/latest/admin/git/mesh/nodes/{{ mesh_node_id }}'
|
|
method: PUT
|
|
headers:
|
|
Content-Type: 'application/json'
|
|
Accept: 'application/json'
|
|
Authorization: 'Basic {{ mesh_basic_auth }}'
|
|
timeout: 60
|
|
body_format: json
|
|
body:
|
|
id: "{{ mesh_node_id }}"
|
|
name: "{{ mesh_node_name }}"
|
|
rpcId: "{{ mesh_node_id }}"
|
|
rpcUrl: "{{ mesh_node_scheme }}://{{ mesh_node_name }}.{{ atl_aws_stack_name }}-{{ ansible_ec2_placement_region }}.{{ atl_hostedzone }}:{{ mesh_node_port }}"
|
|
register: register_mesh_node_result
|
|
until: register_mesh_node_result is not failed
|
|
retries: 5
|
|
delay: 30
|
|
no_log: True
|
|
|
|
- name: Remove orphan_vol lease lock
|
|
ansible.builtin.file:
|
|
path: '{{ atl_shared_mountpoint }}/.{{ orphan_vol }}'
|
|
state: absent
|