more fixes

This commit is contained in:
Lee Goolsbee
2024-03-26 09:32:20 -05:00
parent d58d02f1f6
commit e2ea50d4f7
9 changed files with 40 additions and 24 deletions

View File

@@ -1,6 +1,11 @@
---
bitbucket_mesh_maven_repo: https://packages.atlassian.com/maven-external
bitbucket_mesh_version: "1.3.1"
mesh_properties_file: "{{ atl_product_home }}/mesh.properties"
mesh_node_scheme: "http"
atl_mesh_volume_size: "{{ lookup('env', 'ATL_MESH_VOLUME_SIZE') or '50' }}"
atl_mesh_azname_az1: "{{ lookup('env', 'ATL_MESH_AZNAME_AZ1') or '' }}"
atl_mesh_azname_az2: "{{ lookup('env', 'ATL_MESH_AZNAME_AZ2') or '' }}"
atl_mesh_azname_az3: "{{ lookup('env', 'ATL_MESH_AZNAME_AZ3') or '' }}"
atl_mesh_snapshot_az1: "{{ lookup('env', 'ATL_MESH_SNAPSHOT_AZ1') or '' }}"
atl_mesh_snapshot_az2: "{{ lookup('env', 'ATL_MESH_SNAPSHOT_AZ2') or '' }}"
atl_mesh_snapshot_az3: "{{ lookup('env', 'ATL_MESH_SNAPSHOT_AZ3') or '' }}"
mesh_node_port: "7777"
mesh_node_scheme: "http"
mesh_properties_file: "{{ atl_product_home }}/mesh.properties"

View File

@@ -2,7 +2,7 @@
- name: Touch the JMX password file
ansible.builtin.file:
path: "{{ atl_home_base }}/{{ atl_product_edition }}/jmx.access"
path: "{{ atl_product_home }}/jmx.access"
state: touch
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
@@ -74,7 +74,7 @@
- name: set mesh_node_id var from the existing mesh.properties file
ansible.builtin.set_fact:
mesh_node_id: "{{ lookup('ansible.builtin.ini', 'node.id type=properties file=mesh_properties_file', errors='ignore' )| default('absent', true) }}"
mesh_node_id: "{{ lookup('ansible.builtin.ini', 'node.id type=properties file={{ mesh_properties_file }}', errors='ignore' )| default('absent', true) }}"
- name: set string to test mesh_clone_firstrun (node_name contains meshnode_{{ mesh_node_id }}")
ansible.builtin.set_fact:
@@ -104,7 +104,7 @@
# handle reregistering the correct node if node.id exists
- name: set mesh_node_id var from the existing mesh.properties file
ansible.builtin.set_fact:
mesh_node_id: "{{ lookup('ansible.builtin.ini', 'node.id type=properties file=mesh_properties_file') | split('.') | first }}"
mesh_node_id: "{{ lookup('ansible.builtin.ini', 'node.id type=properties file={{ mesh_properties_file }}') | split('.') | first }}"
# handle functionality relating to starting and registering the mesh service
- name: mesh service related processing

View File

@@ -5,7 +5,7 @@
- name: set mesh_node_name var from the existing mesh.properties file
ansible.builtin.set_fact:
mesh_node_name: "{{ lookup('ansible.builtin.ini', 'node.name type=properties file=mesh_properties_file') | split('.') | first }}"
mesh_node_name: "{{ lookup('ansible.builtin.ini', 'node.name type=properties file={{ mesh_properties_file }}') | split('.') | first }}"
- name: generate a pet name if mesh_node_name is empty or this is a clone firstrun # noqa jinja[invalid]
ansible.builtin.set_fact:

View File

@@ -32,7 +32,7 @@
# 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_home_base }}/{{ atl_product_edition }}/config/{{ item }}"
path: "{{ atl_product_home }}/config/{{ item }}"
state: absent
with_items:
- signing-key.pem

View File

@@ -8,22 +8,21 @@
ansible.builtin.set_fact:
mounts_list: "{{ ansible_mounts | map(attribute='mount') | list }}"
# - name: discover mesh volume device stat
# ansible.builtin.stat:
# path: '/dev/xvdd'
# follow: no
# get_attributes: yes
# register: mesh_device_stat
- name: Retrieve info for this instance from EC2
amazon.aws.ec2_instance_info:
region: "{{ ansible_ec2_placement_region }}"
instance_ids:
- "{{ ansible_ec2_instance_id }}"
retries: 10
delay: 10
register: ec2_instance_facts
until: ec2_instance_facts.error is not defined
- name: pull info for this_instance from instanceFacts
- name: Create list of current block devices attached to this instance
ansible.builtin.set_fact:
this_instance: "{{ instanceFacts.instances | first }}"
devices_list: "{{ ec2_instance_facts.instances[0].block_device_mappings | map(attribute='device_name') | list }}"
- name: create list of current block devices
ansible.builtin.set_fact:
devices_list: "{{ this_instance.block_device_mappings | map(attribute='device_name') | list }}"
- name: discover mesh volume device stat
- name: Discover mesh volume device stat
ansible.builtin.stat:
path: '/dev/xvdd'
follow: no
@@ -39,7 +38,7 @@
# lazy guess at mesh_vol - # TODO make this better
- name: set mesh_vol from currently mounted device
ansible.builtin.set_fact:
mesh_vol: "{{ this_instance | community.general.json_query(vol_id_query) | first }}"
mesh_vol: "{{ ec2_instance_facts.instances[0] | community.general.json_query(vol_id_query) | first }}"
vars:
vol_id_query: "block_device_mappings[?(@.device_name=='/dev/xvdd')].ebs.volume_id"
when: (mesh_device is defined) and (mesh_device|length > 0)