/
galera_install_download_extra_packages.yml
47 lines (44 loc) · 1.95 KB
/
galera_install_download_extra_packages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Ensure that galera_server_extra_package_paths exist
file:
path: "{{ galera_server_extra_package_path }}/{{ item.key }}"
state: directory
with_dict: "{{ galera_server_percona_distro_packages_alt_arch }}"
delegate_to: "{{ (galera_server_extra_package_downloader == 'deployment-host') | ternary('localhost', inventory_hostname) }}"
- name: Download extra packages
get_url:
url: "{{ item.value.url }}"
dest: "{{ galera_server_extra_package_path }}/{{ item.key }}/"
checksum: "{{ item.value.checksum | default(omit) }}"
force: "{{ item.value.checksum is not defined }}"
validate_certs: "{{ galera_server_extra_package_validate_certs }}"
with_dict: "{{ galera_server_percona_distro_packages_alt_arch }}"
register: fetch_url
until: fetch_url is success
retries: 3
delay: 10
delegate_to: "{{ (galera_server_extra_package_downloader == 'deployment-host') | ternary('localhost', inventory_hostname) }}"
- name: Copy downloaded packages from deployment-host to target-host
copy:
src: "{{ galera_server_extra_package_path }}/{{ item.key }}/{{ item.value.url | basename }}"
dest: "{{ galera_server_extra_package_path }}/{{ item.key }}/"
with_dict: "{{ galera_server_percona_distro_packages_alt_arch }}"
when:
- galera_server_extra_package_downloader == "deployment-host"
register: file_copy
until: file_copy is success
retries: 5
delay: 10