diff --git a/roles/jira_config/defaults/main.yml b/roles/jira_config/defaults/main.yml index 5aab24b..b6f42ef 100644 --- a/roles/jira_config/defaults/main.yml +++ b/roles/jira_config/defaults/main.yml @@ -39,3 +39,8 @@ atl_db_removeabandoned: 'true' atl_db_removeabandonedtimeout: '300' atl_db_testwhileidle: 'true' atl_db_testonborrow: 'false' + +# OpenSearch configuration +atl_opensearch_endpoint: "{{ lookup('env', 'ATL_OPENSEARCH_ENDPOINT') }}" +atl_opensearch_password: "{{ lookup('env', 'ATL_OPENSEARCH_PASSWORD') }}" +atl_opensearch_user: "{{ lookup('env', 'ATL_OPENSEARCH_USER') }}" diff --git a/roles/jira_config/tasks/main.yml b/roles/jira_config/tasks/main.yml index c9476a9..6edc68d 100644 --- a/roles/jira_config/tasks/main.yml +++ b/roles/jira_config/tasks/main.yml @@ -33,6 +33,24 @@ mode: 0644 when: jira_config_properties.stat.exists +- name: Configure OpenSearch settings in jira-config.properties + ansible.builtin.lineinfile: + path: "{{ atl_product_home }}/jira-config.properties" + create: true + owner: "{{ atl_product_user }}" + group: "{{ atl_product_user }}" + mode: 0644 + line: "{{ item }}" + with_items: + - "search.platform=opensearch" + - "opensearch.http.url={{ atl_opensearch_endpoint }}" + - "opensearch.aws.region={{ ansible_ec2_placement_region }}" + when: + - atl_opensearch_endpoint is defined + - atl_opensearch_endpoint is not none + - atl_opensearch_endpoint | length > 0 + - ansible_ec2_placement_region is defined + - name: Override JVM memory settings. # Ugly but necessary as the product installs this file so we need to make the change here. ansible.builtin.lineinfile: