From b1ee6f6abb8be677702d4fd74caec28ebf144d5b Mon Sep 17 00:00:00 2001 From: bmeehan Date: Wed, 8 Nov 2023 20:38:31 +1100 Subject: [PATCH 1/8] ITPLT-3356 support opensearch config in confleunce.cfg.xml --- roles/confluence_config/defaults/main.yml | 2 ++ roles/confluence_config/templates/confluence.cfg.xml.j2 | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/confluence_config/defaults/main.yml b/roles/confluence_config/defaults/main.yml index c3fc9c1..d9ea102 100644 --- a/roles/confluence_config/defaults/main.yml +++ b/roles/confluence_config/defaults/main.yml @@ -19,6 +19,8 @@ atl_hazelcast_network_aws_iam_region: "{{ lookup('env', 'ATL_HAZELCAST_NETWORK_A atl_hazelcast_network_aws_iam_role: "{{ lookup('env', 'ATL_HAZELCAST_NETWORK_AWS_IAM_ROLE') }}" atl_hazelcast_network_aws_tag_value: "{{ lookup('env', 'ATL_HAZELCAST_NETWORK_AWS_TAG_VALUE') }}" +atl_opensearch_endpoint: "{{ lookup('env', 'ATL_OPENSEARCH_ENDPOINT') }}" + atl_catalina_opts: "" atl_catalina_opts_extra: >- -Datlassian.event.thread_pool_configuration.queue_size=4096 diff --git a/roles/confluence_config/templates/confluence.cfg.xml.j2 b/roles/confluence_config/templates/confluence.cfg.xml.j2 index fec620d..ed652d0 100644 --- a/roles/confluence_config/templates/confluence.cfg.xml.j2 +++ b/roles/confluence_config/templates/confluence.cfg.xml.j2 @@ -57,6 +57,11 @@ {% if atl_tomcat_contextpath is defined and atl_tomcat_contextpath != '' %} {{ atl_tomcat_contextpath }} {% endif %} - + {# Confluence versions 7.13 and newer #} + {% if atl_opensearch_endpoint is defined and atl_opensearch_endpoint != '' %} + {{ atl_hazelcast_network_aws_iam_region }} + {{ atl_opensearch_endpoint }} + opensearch + {% endif %} \ No newline at end of file From d93cc67e00e526dc832750f9037730763e508680 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Wed, 8 Nov 2023 20:42:34 +1100 Subject: [PATCH 2/8] ITPLT-3356 support opensearch config in confleunce.cfg.xml --- roles/confluence_config/templates/confluence.cfg.xml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/confluence_config/templates/confluence.cfg.xml.j2 b/roles/confluence_config/templates/confluence.cfg.xml.j2 index ed652d0..656577e 100644 --- a/roles/confluence_config/templates/confluence.cfg.xml.j2 +++ b/roles/confluence_config/templates/confluence.cfg.xml.j2 @@ -57,7 +57,7 @@ {% if atl_tomcat_contextpath is defined and atl_tomcat_contextpath != '' %} {{ atl_tomcat_contextpath }} {% endif %} - {# Confluence versions 7.13 and newer #} + {# config specific to opensearch #} {% if atl_opensearch_endpoint is defined and atl_opensearch_endpoint != '' %} {{ atl_hazelcast_network_aws_iam_region }} {{ atl_opensearch_endpoint }} From 7eeff3e8af17f41bf24a6469558fd756e791b25c Mon Sep 17 00:00:00 2001 From: bmeehan Date: Fri, 10 Nov 2023 12:01:44 +1100 Subject: [PATCH 3/8] ITPLT-3356 temp workaround for failing adoptium --- roles/product_common/tasks/amazon-2.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/product_common/tasks/amazon-2.yml b/roles/product_common/tasks/amazon-2.yml index 7538d97..207b637 100644 --- a/roles/product_common/tasks/amazon-2.yml +++ b/roles/product_common/tasks/amazon-2.yml @@ -8,8 +8,12 @@ name: Adoptium file: adoptium description: Adoptium Repo - baseurl: "https://packages.adoptium.net/artifactory/rpm/amazonlinux/{{ ansible_distribution_version }}/{{ ansible_architecture }}" - gpgkey: https://packages.adoptium.net/artifactory/api/gpg/key/public + baseurl: + - "https://packages.adoptium.net/artifactory/rpm/amazonlinux/{{ ansible_distribution_version }}/{{ ansible_architecture }}" + - "https://packages.atlassian.com/artifactory/adoptium-rpm/amazonlinux/2/x86_64" + gpgkey: + - https://packages.adoptium.net/artifactory/api/gpg/key/public + - https://packages.atlassian.com/artifactory/adoptium-rpm/amazonlinux/2/x86_64/repodata/repomd.xml.key gpgcheck: yes state: present From acc72cb739ef6ec906d8eb11e9141df337c898b1 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Fri, 8 Mar 2024 08:09:52 +1100 Subject: [PATCH 4/8] ITPLT-3356 add OS user and pass if provided and exclude region if OS pass provided --- roles/confluence_config/defaults/main.yml | 2 ++ roles/confluence_config/templates/confluence.cfg.xml.j2 | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/confluence_config/defaults/main.yml b/roles/confluence_config/defaults/main.yml index d9ea102..d5ba7bc 100644 --- a/roles/confluence_config/defaults/main.yml +++ b/roles/confluence_config/defaults/main.yml @@ -20,6 +20,8 @@ atl_hazelcast_network_aws_iam_role: "{{ lookup('env', 'ATL_HAZELCAST_NETWORK_AWS atl_hazelcast_network_aws_tag_value: "{{ lookup('env', 'ATL_HAZELCAST_NETWORK_AWS_TAG_VALUE') }}" atl_opensearch_endpoint: "{{ lookup('env', 'ATL_OPENSEARCH_ENDPOINT') }}" +atl_opensearch_password: "{{ lookup('env', 'ATL_OPENSEARCH_PASSWORD') }}" +atl_opensearch_user: "{{ lookup('env', 'ATL_OPENSEARCH_USER') }}" atl_catalina_opts: "" atl_catalina_opts_extra: >- diff --git a/roles/confluence_config/templates/confluence.cfg.xml.j2 b/roles/confluence_config/templates/confluence.cfg.xml.j2 index 656577e..1a707eb 100644 --- a/roles/confluence_config/templates/confluence.cfg.xml.j2 +++ b/roles/confluence_config/templates/confluence.cfg.xml.j2 @@ -59,9 +59,15 @@ {% endif %} {# config specific to opensearch #} {% if atl_opensearch_endpoint is defined and atl_opensearch_endpoint != '' %} + {% if atl_opensearch_password is defined and atl_opensearch_endpoint = '' %} {{ atl_hazelcast_network_aws_iam_region }} - {{ atl_opensearch_endpoint }} + {% else %} + {{ atl_opensearch_password }} + {{ atl_opensearch_user }} + {% endif %} + https://{{ atl_opensearch_endpoint }} opensearch {% endif %} + {% endif %} \ No newline at end of file From da56d513e0656d04c019267e89e7827435b0352d Mon Sep 17 00:00:00 2001 From: bmeehan Date: Fri, 8 Mar 2024 08:26:41 +1100 Subject: [PATCH 5/8] ITPLT-3356 add OS user and pass if provided and exclude region if OS pass provided --- roles/confluence_config/templates/confluence.cfg.xml.j2 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/confluence_config/templates/confluence.cfg.xml.j2 b/roles/confluence_config/templates/confluence.cfg.xml.j2 index 1a707eb..04d1130 100644 --- a/roles/confluence_config/templates/confluence.cfg.xml.j2 +++ b/roles/confluence_config/templates/confluence.cfg.xml.j2 @@ -59,11 +59,12 @@ {% endif %} {# config specific to opensearch #} {% if atl_opensearch_endpoint is defined and atl_opensearch_endpoint != '' %} - {% if atl_opensearch_password is defined and atl_opensearch_endpoint = '' %} - {{ atl_hazelcast_network_aws_iam_region }} - {% else %} + {# if password provided set password and user but NOT region #} + {% if atl_opensearch_password is defined and atl_opensearch_password != '' %} {{ atl_opensearch_password }} {{ atl_opensearch_user }} + {% else %} + {{ atl_hazelcast_network_aws_iam_region }} {% endif %} https://{{ atl_opensearch_endpoint }} opensearch From 11c23b716994e3b2f69669e4638ef4cef225c312 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Fri, 8 Mar 2024 14:10:18 +1100 Subject: [PATCH 6/8] ITPLT-3356 clean up formatting in c.c.xml --- .../templates/confluence.cfg.xml.j2 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/roles/confluence_config/templates/confluence.cfg.xml.j2 b/roles/confluence_config/templates/confluence.cfg.xml.j2 index 04d1130..44aef3f 100644 --- a/roles/confluence_config/templates/confluence.cfg.xml.j2 +++ b/roles/confluence_config/templates/confluence.cfg.xml.j2 @@ -26,7 +26,7 @@ {% endif -%} {# Confluence versions 7.13 and newer #} - {% if (atl_product_version.split(".")[0] | int() == 7 and atl_product_version.split(".")[1] | int() <= 13) or atl_product_version.split(".")[0] | int() < 7 %} + {%- if (atl_product_version.split(".")[0] | int() == 7 and atl_product_version.split(".")[1] | int() <= 13) or atl_product_version.split(".")[0] | int() < 7 -%} {{ atl_db_poolminsize }} {{ atl_db_poolmaxsize }} {{ atl_db_timeout }} @@ -35,7 +35,7 @@ {{ atl_db_validate }} {{ atl_db_acquireincrement }} {{ atl_db_preferredtestquery }} - {% else %} + {%- else -%} {{ atl_db_timeout }} {{ atl_db_poolmaxsize }} {{ atl_db_poolminsize }} @@ -54,21 +54,24 @@ aws {{ atl_aws_stack_name }} 1 - {% if atl_tomcat_contextpath is defined and atl_tomcat_contextpath != '' %} + {%- if atl_tomcat_contextpath is defined and atl_tomcat_contextpath != '' -%} {{ atl_tomcat_contextpath }} {% endif %} {# config specific to opensearch #} - {% if atl_opensearch_endpoint is defined and atl_opensearch_endpoint != '' %} + {%- if atl_opensearch_endpoint is defined and atl_opensearch_endpoint != '' %} {# if password provided set password and user but NOT region #} {% if atl_opensearch_password is defined and atl_opensearch_password != '' %} + {{ atl_opensearch_password }} {{ atl_opensearch_user }} - {% else %} + {%- else %} + {{ atl_hazelcast_network_aws_iam_region }} {% endif %} + https://{{ atl_opensearch_endpoint }} opensearch - {% endif %} - {% endif %} + {%- endif %} + \ No newline at end of file From 2f198d478bcaa20975b9ab8ae5819ac1f1571762 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Fri, 8 Mar 2024 16:22:31 +1100 Subject: [PATCH 7/8] ITPLT-3356 correct user to username --- roles/confluence_config/templates/confluence.cfg.xml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/confluence_config/templates/confluence.cfg.xml.j2 b/roles/confluence_config/templates/confluence.cfg.xml.j2 index 44aef3f..bc0811f 100644 --- a/roles/confluence_config/templates/confluence.cfg.xml.j2 +++ b/roles/confluence_config/templates/confluence.cfg.xml.j2 @@ -63,7 +63,7 @@ {% if atl_opensearch_password is defined and atl_opensearch_password != '' %} {{ atl_opensearch_password }} - {{ atl_opensearch_user }} + {{ atl_opensearch_user }} {%- else %} {{ atl_hazelcast_network_aws_iam_region }} From 37b2d911b7458b6e1ffdb012a116bce1e3d9fbad Mon Sep 17 00:00:00 2001 From: bmeehan Date: Sat, 9 Mar 2024 10:08:21 +1100 Subject: [PATCH 8/8] ITPLT-3356 remove unneeded precommit config --- .pre-commit-config.yaml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 88afabf..99f59b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,17 +33,4 @@ repos: - id: encryption-check always_run: true files: vault.ya?ml$ - - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.55.0 - hooks: - - id: eslint - language_version: 14.19.1 - files: nginx-rewrite-scripts/.*\.[jt]sx?$ - args: - - --config=scripts/nginx-rewrite-scripts/.eslintrc.cjs - additional_dependencies: - - eslint@8.17.0 - - eslint-config-airbnb-base@15.0.0 - - eslint-plugin-import@2.26.0 - stages: - - manual +