mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 00:13:09 -06:00
161 lines
5.7 KiB
YAML
161 lines
5.7 KiB
YAML
---
|
|
|
|
- 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_home_shared }}/attachments"
|
|
- "{{ atl_product_shared_plugins }}"
|
|
changed_when: false # For Molecule idempotence check
|
|
|
|
# Create symlink to force single (unclustered) Confluence to store
|
|
# shared-data and attachments in the shared drive.
|
|
- name: Symlink local attachments to shared storage
|
|
ansible.builtin.file:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
force: false
|
|
state: link
|
|
mode: 0750
|
|
owner: "{{ atl_product_user }}"
|
|
group: "{{ atl_product_user }}"
|
|
loop:
|
|
- {src: "{{ atl_product_home_shared }}/", dest: "{{ atl_product_home }}/shared-home"}
|
|
- {src: "{{ atl_product_home_shared }}/attachments/", dest: "{{ atl_product_home }}/attachments"}
|
|
|
|
- name: Create Tomcat server config
|
|
ansible.builtin.template:
|
|
src: server.xml.j2
|
|
dest: "{{ atl_product_installation_versioned }}/conf/server.xml"
|
|
|
|
- name: Override JVM memory settings.
|
|
ansible.builtin.replace:
|
|
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
|
|
regexp: "-{{ item }}\\d+m "
|
|
replace: "-{{ item }}{{ atl_jvm_heap }} "
|
|
with_items:
|
|
- 'Xmx'
|
|
- 'Xms'
|
|
|
|
- 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: Configure login properties
|
|
ansible.builtin.template:
|
|
src: seraph-config.xml.j2
|
|
dest: "{{ atl_product_installation_versioned }}/confluence/WEB-INF/classes/seraph-config.xml"
|
|
|
|
- name: Configure Confluence home directory
|
|
ansible.builtin.template:
|
|
src: confluence-init.properties.j2
|
|
dest: "{{ atl_product_installation_versioned }}/confluence/WEB-INF/classes/confluence-init.properties"
|
|
|
|
- name: Create Confluence configuration
|
|
ansible.builtin.template:
|
|
src: confluence.cfg.xml.j2
|
|
dest: "{{ atl_product_home }}/confluence.cfg.xml"
|
|
owner: "{{ atl_product_user }}"
|
|
group: "{{ atl_product_user }}"
|
|
|
|
- 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 bandana set bandanavalue=regexp_replace(bandanavalue, %s, %s)
|
|
where bandanacontext = '_GLOBAL' and bandanakey = 'atlassian.confluence.settings';
|
|
positional_args:
|
|
- "<baseUrl>.*</baseUrl>"
|
|
- "<baseUrl>{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}{{ atl_tomcat_contextpath }}</baseUrl>"
|
|
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
|
|
|
|
- name: Create JVM font fallback directories
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: 0755
|
|
with_items: "{{ atl_fonts_fallback_dirs }}"
|
|
|
|
- name: Install & configure Amazon-Linux-specific language fonts
|
|
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}_fonts.yml"
|
|
when: ansible_distribution | lower == 'amazon'
|
|
|
|
- name: Install & configure Ubuntu/Debian-specific language fonts
|
|
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}_fonts.yml"
|
|
when: ansible_distribution | lower != 'amazon'
|