mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 08:53:07 -06:00
DCD-224: Refactor installer role to work around various quirks.
This commit is contained in:
15
roles/installer_download/tasks/create_dirs.yml
Normal file
15
roles/installer_download/tasks/create_dirs.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Create installation directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ atl_product_user }}"
|
||||
group: "{{ atl_product_user }}"
|
||||
with_items:
|
||||
- "{{ atl_installer_temp }}"
|
||||
- "{{ atl_product_home }}"
|
||||
- "{{ atl_product_installation_versioned }}"
|
||||
- "{{ atl_product_version_cache_dir }}"
|
||||
changed_when: false # For Molecule idempotence check
|
||||
@@ -15,11 +15,18 @@
|
||||
template:
|
||||
src: "{{ atl_product_family }}.varfile.j2"
|
||||
dest: "{{ atl_product_varfile }}"
|
||||
mode: 0755
|
||||
|
||||
# NOTE: We run the installer as the user rather than root to limit its
|
||||
# actions. For example, if root and the 'jira' user exists then it
|
||||
# will create 'jira1'; this potentially creates idempotency/upgrade
|
||||
# issues down the line.
|
||||
- name: Run the installer
|
||||
command: /bin/sh "{{ atl_product_download }}" -q -varfile "{{ atl_product_varfile }}"
|
||||
args:
|
||||
creates: "{{ atl_product_installation_versioned }}/.install4j/"
|
||||
become: true
|
||||
become_user: "{{ atl_product_user }}"
|
||||
|
||||
- name: Symlink the installed version to current
|
||||
file:
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Create installation directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
with_items:
|
||||
- "{{ atl_installer_temp }}"
|
||||
- "{{ atl_product_home_shared }}"
|
||||
|
||||
|
||||
# Common case for most products and Jira editions.
|
||||
- name: Fetch ServiceDesk metadata if necessary
|
||||
include_tasks: "servicedesk_download.yml"
|
||||
@@ -17,7 +7,8 @@
|
||||
|
||||
# Differences for ServiceDesk become fiddly enough that it's better to
|
||||
# just split them out and move common functionality into individual
|
||||
# task files.
|
||||
# task files. This gives us some flexibility in the future if
|
||||
# necessary.
|
||||
- name: Fetch product metadata if necessary
|
||||
include_tasks: "product_download.yml"
|
||||
when: atl_product_edition != "jira-servicedesk"
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Create installation directories if necesary
|
||||
include_tasks: "create_dirs.yml"
|
||||
|
||||
- name: Check for and load cached version
|
||||
include_tasks: "cached_version_fetch.yml"
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Create installation directories if necesary
|
||||
include_tasks: "create_dirs.yml"
|
||||
|
||||
- name: Check for and load cached version
|
||||
include_tasks: "cached_version_fetch.yml"
|
||||
|
||||
@@ -12,7 +15,7 @@
|
||||
set_fact:
|
||||
atl_servicedesk_version_json: "{{ lookup('url', '{{ atl_servicedesk_latest_url }}') }}"
|
||||
|
||||
- name: Set the Jira version for ServiceDesk
|
||||
- name: Set the version for ServiceDesk
|
||||
set_fact:
|
||||
atl_product_version: "{{ atl_servicedesk_version_json.name }}"
|
||||
|
||||
@@ -31,4 +34,4 @@
|
||||
atl_download_edition: "servicedesk"
|
||||
|
||||
- name: Fetch and unpack the product distribution
|
||||
include_tasks: "fetch_product.yml"
|
||||
include_tasks: "fetch_product.yml"
|
||||
|
||||
Reference in New Issue
Block a user