mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 00:43:06 -06:00
ITOPSENG-164 Yamllint fix
This commit is contained in:
@@ -126,15 +126,18 @@
|
|||||||
dest: "{{ atl_product_version_cache }}"
|
dest: "{{ atl_product_version_cache }}"
|
||||||
force: true
|
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 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
|
- name: Assume temp binary should be downloaded
|
||||||
set_fact:
|
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
|
- name: Check download lock directory exists
|
||||||
stat:
|
stat:
|
||||||
path: "{{ atl_product_home_shared_download_lockdir }}"
|
path: "{{ atl_product_home_shared_download_lockdir }}"
|
||||||
@@ -148,51 +151,51 @@
|
|||||||
# If binary exists and lockdir exists use this binary instead
|
# If binary exists and lockdir exists use this binary instead
|
||||||
- name: Check Lock Directory and binary exists on shared_home
|
- name: Check Lock Directory and binary exists on shared_home
|
||||||
set_fact:
|
set_fact:
|
||||||
download_binary: no
|
download_binary: false
|
||||||
when:
|
when:
|
||||||
- home_shared_downloaded.stat.exists
|
- home_shared_downloaded.stat.exists
|
||||||
- download_lockdir.stat.isdir is defined
|
- download_lockdir.stat.isdir is defined
|
||||||
- download_lockdir.stat.isdir
|
- download_lockdir.stat.isdir
|
||||||
|
|
||||||
# If the binary was never installed, download it
|
# If the binary was never installed, download it
|
||||||
- name: "Download product installer and move to shared directory"
|
- name: "Download product installer and move to shared directory"
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Fetch product installer
|
- name: Fetch product installer
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ atl_product_download_url }}"
|
url: "{{ atl_product_download_url }}"
|
||||||
dest: "{{ atl_product_download }}"
|
dest: "{{ atl_product_download }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
force: false
|
force: false
|
||||||
register: atl_product_downloaded
|
register: atl_product_downloaded
|
||||||
|
|
||||||
- name: Remove lockdir to prevent nodes relying on binary when copying
|
- name: Remove lockdir to prevent nodes relying on binary when copying
|
||||||
file:
|
file:
|
||||||
path: "{{ atl_product_home_shared_download_lockdir }}"
|
path: "{{ atl_product_home_shared_download_lockdir }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: atl_product_downloaded is succeeded
|
when: atl_product_downloaded is succeeded
|
||||||
register: lockdir_removed
|
register: lockdir_removed
|
||||||
|
|
||||||
- name: Copy temp installer to home_shared
|
- name: Copy temp installer to home_shared
|
||||||
copy:
|
copy:
|
||||||
src: "{{ atl_product_download }}"
|
src: "{{ atl_product_download }}"
|
||||||
dest: "{{ atl_product_home_shared_download }}"
|
dest: "{{ atl_product_home_shared_download }}"
|
||||||
remote_src: yes
|
remote_src: true
|
||||||
when: lockdir_removed is succeeded
|
when: lockdir_removed is succeeded
|
||||||
register: copied
|
register: copied
|
||||||
|
|
||||||
- name: Delete old temp installer
|
- name: Delete old temp installer
|
||||||
file:
|
file:
|
||||||
path: "{{ atl_product_download }}"
|
path: "{{ atl_product_download }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: copied is succeeded
|
when: copied is succeeded
|
||||||
register: temp_deleted
|
register: temp_deleted
|
||||||
|
|
||||||
- name: Create lockdir once product installer downloaded and moved
|
- name: Create lockdir once product installer downloaded and moved
|
||||||
file:
|
file:
|
||||||
path: "{{ atl_product_home_shared_download_lockdir }}"
|
path: "{{ atl_product_home_shared_download_lockdir }}"
|
||||||
state: directory
|
state: directory
|
||||||
when: temp_deleted is succeeded
|
when: temp_deleted is succeeded
|
||||||
|
|
||||||
when: download_binary
|
when: download_binary
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user