Files
dc-deployments-automation/roles/product_install/tasks/jira-servicedesk_as_obr.yml
2019-10-18 18:11:00 +11:00

66 lines
2.1 KiB
YAML

---
- name: Get the installer product version info
uri:
url: "https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions/name/{{ atl_product_version }}"
return_content: yes
register: atl_product_version_info
- name: Show the returned build number
debug:
msg="buildNumber={{ atl_product_version_info.json.buildNumber }}"
- name: Get the JSD build version info
uri:
url: "https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions/latest?application=\
jira&applicationBuild={{ atl_product_version_info.json.buildNumber }}"
return_content: yes
register: atl_jsd_build_info
- name: Show the returned obr binary href
debug:
msg="obr_ref={{ atl_jsd_build_info.json._embedded.artifact._links.binary.href }}"
- name: Fetch the jsd obr
get_url:
url: "{{ atl_jsd_build_info.json._embedded.artifact._links.binary.href }}"
dest: "{{ atl_installer_temp }}"
register: jsdobr
- name: check the name of the downloaded file
debug:
msg="{{ jsdobr.dest }}"
- name: Copy the obr to shared_home
copy:
src: "{{ jsdobr.dest }}"
dest: "{{ atl_product_version_cache_dir }}"
remote_src: true
- name: Ensure instaled-plugins dir exists
file:
path: "{{ atl_product_version_cache_dir }}/plugins/installed-plugins"
state: directory
mode: 0750
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
- name: Unpack the obr into the installed-plugins dir
unarchive:
remote_src: true
src: "{{ jsdobr.dest }}"
dest: "{{ atl_product_version_cache_dir }}/plugins/installed-plugins"
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
mode: 0750
# Ansible unarchive task validation does not work with the -j flag so we need to achieve the same result in 2 steps
# extra_opts:
# - "-j"
- name: Copy JSD dependency jars into the installed-plugins dir
copy:
src: "{{ item }}"
dest: "{{ atl_product_version_cache_dir }}/plugins/installed-plugins"
remote_src: true
with_fileglob: "{{ atl_product_version_cache_dir }}/plugins/installed-plugins/dependencies/*.jar"