Files
dc-deployments-automation/roles/bitbucket_mesh_config/tasks/mesh_service.yml
Lee Goolsbee e2ea50d4f7 more fixes
2024-03-26 09:32:20 -05:00

59 lines
1.9 KiB
YAML

---
- name: Enable and Start Mesh Product
ansible.builtin.service:
name: "{{ atl_systemd_service_name }}"
enabled: true
state: started
when:
- molecule_yml is not defined
no_log: true
- name: Wait for service to become available
ansible.builtin.wait_for:
port: "{{ mesh_node_port }}"
timeout: 300
delegate_to: localhost
become: false
register: mesh_service_waiter
- 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: update_mesh_node
when:
- 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 }}']"
# 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 register this new mesh node
ansible.builtin.assert:
that:
- mesh_nodes_report.json | community.general.json_query(query) | length == 0
changed_when: true
notify: register_mesh_node
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: "[?id=='{{ mesh_node_id }}']"