mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 00:13:09 -06:00
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
---
|
|
|
|
# if node.id doesnt exist this is new/clean mesh node and we need to register a new node
|
|
- name: If this node is not registered, cleanup any old keys to allow registration of new
|
|
ansible.builtin.file:
|
|
path: "{{ atl_product_home }}/config/{{ item }}"
|
|
state: absent
|
|
with_items:
|
|
- signing-key.pem
|
|
- control-plane.pem
|
|
when:
|
|
- bitbucket_cluster_available
|
|
- mesh_nodes_report.json | community.general.json_query(query) | length == 0
|
|
- (mesh_node_id is not defined) or (mesh_node_id | length == 0)
|
|
vars:
|
|
query: "[?name=='{{ mesh_node_name }}']"
|
|
|
|
- name: Trigger the handler to update this existing mesh node
|
|
ansible.builtin.assert:
|
|
that:
|
|
- mesh_nodes_report.json | community.general.json_query(query) | length == 0
|
|
changed_when: true
|
|
notify:
|
|
- Enable Product
|
|
- Restart Product
|
|
- Wait for Mesh to become available
|
|
- Update Existing Mesh Node
|
|
when:
|
|
- atl_startup_restart | bool
|
|
- bitbucket_cluster_available
|
|
- mesh_nodes_report.json | community.general.json_query(query) | length == 0
|
|
- (mesh_node_id is defined) and (mesh_node_id | length > 0)
|
|
vars:
|
|
query: "[?name=='{{ mesh_node_name }}']"
|
|
|
|
- name: Trigger the handler to register this new mesh node
|
|
ansible.builtin.assert:
|
|
that:
|
|
- mesh_nodes_report.json | community.general.json_query(query) | length == 0
|
|
changed_when: true
|
|
notify:
|
|
- Enable Product
|
|
- Restart Product
|
|
- Wait for Mesh to become available
|
|
- Register New Mesh Node
|
|
when:
|
|
- atl_startup_restart | bool
|
|
- bitbucket_cluster_available
|
|
- mesh_nodes_report.json | community.general.json_query(query) | length == 0
|
|
- (mesh_node_id is not defined) or (mesh_node_id | length == 0)
|
|
vars:
|
|
query: "[?id=='{{ mesh_node_id }}']"
|