mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 08:23:06 -06:00
ITOPSENG-164 Yamllint fix
This commit is contained in:
@@ -126,15 +126,18 @@
|
||||
dest: "{{ atl_product_version_cache }}"
|
||||
force: true
|
||||
|
||||
# For the first run a temp binary should be downloaded but moved to shared home to ensure all subsequent nodes have access
|
||||
# For the first run a temp binary should be downloaded but moved to
|
||||
# shared home to ensure all subsequent nodes have access
|
||||
# to the same specific version binary.
|
||||
# To prevent a race condition with multiple downloads at the same time a directory is used as a lockfile (atomic operation).
|
||||
# To prevent a race condition with multiple downloads at the same time
|
||||
# a directory is used as a lockfile (atomic operation).
|
||||
|
||||
- name: Assume temp binary should be downloaded
|
||||
set_fact:
|
||||
download_binary: yes
|
||||
download_binary: true
|
||||
|
||||
# Check for product installer in home_shared and lockdir to determine if it needs to be downloaded again.
|
||||
# Check for product installer in home_shared and lockdir to determine
|
||||
# if it needs to be downloaded again.
|
||||
- name: Check download lock directory exists
|
||||
stat:
|
||||
path: "{{ atl_product_home_shared_download_lockdir }}"
|
||||
@@ -148,51 +151,51 @@
|
||||
# If binary exists and lockdir exists use this binary instead
|
||||
- name: Check Lock Directory and binary exists on shared_home
|
||||
set_fact:
|
||||
download_binary: no
|
||||
download_binary: false
|
||||
when:
|
||||
- home_shared_downloaded.stat.exists
|
||||
- download_lockdir.stat.isdir is defined
|
||||
- download_lockdir.stat.isdir
|
||||
- home_shared_downloaded.stat.exists
|
||||
- download_lockdir.stat.isdir is defined
|
||||
- download_lockdir.stat.isdir
|
||||
|
||||
# If the binary was never installed, download it
|
||||
- name: "Download product installer and move to shared directory"
|
||||
block:
|
||||
|
||||
- name: Fetch product installer
|
||||
get_url:
|
||||
url: "{{ atl_product_download_url }}"
|
||||
dest: "{{ atl_product_download }}"
|
||||
mode: 0755
|
||||
force: false
|
||||
register: atl_product_downloaded
|
||||
- name: Fetch product installer
|
||||
get_url:
|
||||
url: "{{ atl_product_download_url }}"
|
||||
dest: "{{ atl_product_download }}"
|
||||
mode: 0755
|
||||
force: false
|
||||
register: atl_product_downloaded
|
||||
|
||||
- name: Remove lockdir to prevent nodes relying on binary when copying
|
||||
file:
|
||||
path: "{{ atl_product_home_shared_download_lockdir }}"
|
||||
state: absent
|
||||
when: atl_product_downloaded is succeeded
|
||||
register: lockdir_removed
|
||||
- name: Remove lockdir to prevent nodes relying on binary when copying
|
||||
file:
|
||||
path: "{{ atl_product_home_shared_download_lockdir }}"
|
||||
state: absent
|
||||
when: atl_product_downloaded is succeeded
|
||||
register: lockdir_removed
|
||||
|
||||
- name: Copy temp installer to home_shared
|
||||
copy:
|
||||
src: "{{ atl_product_download }}"
|
||||
dest: "{{ atl_product_home_shared_download }}"
|
||||
remote_src: yes
|
||||
when: lockdir_removed is succeeded
|
||||
register: copied
|
||||
- name: Copy temp installer to home_shared
|
||||
copy:
|
||||
src: "{{ atl_product_download }}"
|
||||
dest: "{{ atl_product_home_shared_download }}"
|
||||
remote_src: true
|
||||
when: lockdir_removed is succeeded
|
||||
register: copied
|
||||
|
||||
- name: Delete old temp installer
|
||||
file:
|
||||
path: "{{ atl_product_download }}"
|
||||
state: absent
|
||||
when: copied is succeeded
|
||||
register: temp_deleted
|
||||
- name: Delete old temp installer
|
||||
file:
|
||||
path: "{{ atl_product_download }}"
|
||||
state: absent
|
||||
when: copied is succeeded
|
||||
register: temp_deleted
|
||||
|
||||
- name: Create lockdir once product installer downloaded and moved
|
||||
file:
|
||||
path: "{{ atl_product_home_shared_download_lockdir }}"
|
||||
state: directory
|
||||
when: temp_deleted is succeeded
|
||||
- name: Create lockdir once product installer downloaded and moved
|
||||
file:
|
||||
path: "{{ atl_product_home_shared_download_lockdir }}"
|
||||
state: directory
|
||||
when: temp_deleted is succeeded
|
||||
|
||||
when: download_binary
|
||||
|
||||
|
||||
Reference in New Issue
Block a user