mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 00:13:09 -06:00
154 lines
5.2 KiB
YAML
154 lines
5.2 KiB
YAML
---
|
|
|
|
|
|
- name: Create database config
|
|
ansible.builtin.template:
|
|
src: dbconfig.xml.j2
|
|
dest: "{{ atl_product_home }}/dbconfig.xml"
|
|
owner: "{{ atl_product_user }}"
|
|
|
|
- name: Create cluster config
|
|
ansible.builtin.template:
|
|
src: cluster.properties.j2
|
|
dest: "{{ atl_product_home }}/cluster.properties"
|
|
owner: "{{ atl_product_user }}"
|
|
|
|
- name: Create server config
|
|
ansible.builtin.template:
|
|
src: server.xml.j2
|
|
dest: "{{ atl_product_installation_versioned }}/conf/server.xml"
|
|
|
|
- name: Check for a jira-config.properties in the shared home
|
|
ansible.builtin.stat:
|
|
path: "{{ atl_product_home_shared }}/jira-config.properties"
|
|
register: jira_config_properties
|
|
|
|
- name: Copy jira-config.properties if exists
|
|
ansible.builtin.copy:
|
|
remote_src: true
|
|
src: "{{ atl_product_home_shared }}/jira-config.properties"
|
|
dest: "{{ atl_product_home }}/jira-config.properties"
|
|
owner: "{{ atl_product_user }}"
|
|
group: "{{ atl_product_user }}"
|
|
mode: 0644
|
|
when: jira_config_properties.stat.exists
|
|
|
|
- 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:
|
|
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
|
|
backrefs: true
|
|
regexp: "^{{ item }}="
|
|
line: "{{ item }}=\"{{ atl_jvm_heap }}\""
|
|
with_items:
|
|
- 'JVM_MINIMUM_MEMORY'
|
|
- 'JVM_MAXIMUM_MEMORY'
|
|
|
|
- name: Set Jira home directory
|
|
ansible.builtin.lineinfile:
|
|
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
|
|
regexp: "JIRA_HOME="
|
|
line: 'JIRA_HOME="{{ atl_product_home }}"'
|
|
|
|
- name: Set the Tomcat environment
|
|
ansible.builtin.lineinfile:
|
|
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
|
|
insertafter: "EOF"
|
|
line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"'
|
|
|
|
- name: Set support recommended JVM args
|
|
ansible.builtin.lineinfile:
|
|
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
|
|
regexp: "JVM_SUPPORT_RECOMMENDED_ARGS="
|
|
line: 'JVM_SUPPORT_RECOMMENDED_ARGS="{{ atl_jvm_opts }}"'
|
|
|
|
- name: Create application directories
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: 0750
|
|
owner: "{{ atl_product_user }}"
|
|
group: "{{ atl_product_user }}"
|
|
with_items:
|
|
- "{{ atl_product_home }}"
|
|
- "{{ atl_product_home_shared }}"
|
|
- "{{ atl_product_shared_plugins }}"
|
|
changed_when: false # For Molecule idempotence check
|
|
|
|
- name: Limit permissions on the installer temp directory, recursively
|
|
ansible.builtin.file:
|
|
path: "{{ atl_installer_temp }}"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "u=rwX,g=rX,o=rX"
|
|
recurse: true
|
|
changed_when: false # For Molecule idempotence check
|
|
|
|
- name: Limit permissions on the installation directory, non-recursively
|
|
ansible.builtin.file:
|
|
path: "{{ atl_product_installation_versioned }}"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "u=rwX,g=rX,o=rX"
|
|
changed_when: false # For Molecule idempotence check
|
|
|
|
- name: Find top-level files/directories in installation directory, excluding working directories
|
|
ansible.builtin.find:
|
|
paths: "{{ atl_product_installation_versioned }}"
|
|
depth: 1
|
|
file_type: any
|
|
excludes: logs,temp,work
|
|
register: atl_product_installation_versioned_file_list
|
|
|
|
- name: Limit permissions on files and directories in the installation directory, recursively, excluding working directories
|
|
ansible.builtin.file:
|
|
path: "{{ item.path }}"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "u=rwX,g=rX,o=rX"
|
|
recurse: "{{ item.isdir }}"
|
|
loop: "{{ atl_product_installation_versioned_file_list.files }}"
|
|
changed_when: false # For Molecule idempotence check
|
|
|
|
- name: Grant access to the product working directories
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: "u=rwX,g=rX,o-rwx"
|
|
owner: "{{ atl_product_user }}"
|
|
group: "{{ atl_product_user }}"
|
|
recurse: true
|
|
with_items:
|
|
- "{{ atl_product_installation_versioned }}/logs"
|
|
- "{{ atl_product_installation_versioned }}/temp"
|
|
- "{{ atl_product_installation_versioned }}/work"
|
|
changed_when: false # For Molecule idempotence check
|
|
|
|
- name: Create conf/Catalina directory owned by product so catalina.out logging works
|
|
ansible.builtin.file:
|
|
path: "{{ atl_product_installation_versioned }}/conf/Catalina"
|
|
state: directory
|
|
mode: "u=rwX,g=rX,o-rwx"
|
|
owner: "{{ atl_product_user }}"
|
|
group: "{{ atl_product_user }}"
|
|
changed_when: false # For Molecule idempotence check
|
|
|
|
- name: Assert baseurl to same as atl_proxy_name
|
|
community.postgresql.postgresql_query:
|
|
login_host: "{{ atl_db_host }}"
|
|
login_user: "{{ atl_jdbc_user }}"
|
|
login_password: "{{ atl_jdbc_password }}"
|
|
db: "{{ atl_jdbc_db_name }}"
|
|
query: >
|
|
update propertystring set propertyvalue=%s
|
|
where id=(select id from propertyentry where property_key = 'jira.baseurl')
|
|
positional_args:
|
|
- "{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}{{ atl_tomcat_contextpath }}"
|
|
when:
|
|
- atl_proxy_name is defined
|
|
- atl_tomcat_scheme is defined
|
|
- db_created is undefined or not db_created.changed
|
|
tags:
|
|
- skip_on_stack_update
|
|
ignore_errors: yes # For Molecule as it has no db test framework included
|