diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..99f59b8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,36 @@ +--- +default_install_hook_types: [pre-commit, prepare-commit-msg] +default_stages: [pre-commit] +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-yaml + - id: detect-private-key + exclude: '(vault.yml.template|filter_catalina.yaml.j2)' + - id: trailing-whitespace + - repo: https://github.com/avilaton/add-msg-issue-prefix-hook + rev: v0.0.9 + hooks: + - id: add-msg-issue-prefix + args: + - --template={} + - --pattern=[a-zA-Z0-9]{1,10}-[0-9]{1,6} + - repo: https://github.com/ansible/ansible-lint.git + rev: v6.12.2 + hooks: + - id: ansible-lint + additional_dependencies: + - . + - ansible-core==2.13.10 + - jmespath + language_version: python3.8 + - repo: https://github.com/IamTheFij/ansible-pre-commit.git + rev: v0.1.2 + hooks: + - id: encryption-check + always_run: true + files: vault.ya?ml$ + diff --git a/roles/confluence_config/defaults/main.yml b/roles/confluence_config/defaults/main.yml index c3fc9c1..d5ba7bc 100644 --- a/roles/confluence_config/defaults/main.yml +++ b/roles/confluence_config/defaults/main.yml @@ -19,6 +19,10 @@ 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_opensearch_password: "{{ lookup('env', 'ATL_OPENSEARCH_PASSWORD') }}" +atl_opensearch_user: "{{ lookup('env', 'ATL_OPENSEARCH_USER') }}" + 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..bc0811f 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,9 +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 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 + {%- endif %} \ No newline at end of file