Skip to content

Commit 630be99

Browse files
authored
Several attempts to install apt and package (vitabaks#285)
1 parent e4a7524 commit 630be99

File tree

30 files changed

+331
-1
lines changed

30 files changed

+331
-1
lines changed

add_balancer.yml

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
apt:
4040
update_cache: true
4141
cache_valid_time: 3600
42+
register: apt_status
43+
until: apt_status is success
44+
delay: 5
45+
retries: 3
4246
environment: "{{ proxy_env | default({}) }}"
4347
when: ansible_os_family == "Debian" and installation_method == "repo"
4448

@@ -48,6 +52,10 @@
4852
- gnupg
4953
- apt-transport-https
5054
state: present
55+
register: apt_status
56+
until: apt_status is success
57+
delay: 5
58+
retries: 3
5159
environment: "{{ proxy_env | default({}) }}"
5260
when: ansible_os_family == "Debian" and installation_method == "repo"
5361

add_pgnode.yml

+8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
apt:
3838
update_cache: true
3939
cache_valid_time: 3600
40+
register: apt_status
41+
until: apt_status is success
42+
delay: 5
43+
retries: 3
4044
environment: "{{ proxy_env | default({}) }}"
4145
when: ansible_os_family == "Debian" and installation_method == "repo"
4246

@@ -46,6 +50,10 @@
4650
- gnupg
4751
- apt-transport-https
4852
state: present
53+
register: apt_status
54+
until: apt_status is success
55+
delay: 5
56+
retries: 3
4957
environment: "{{ proxy_env | default({}) }}"
5058
when: ansible_os_family == "Debian" and installation_method == "repo"
5159

balancers.yml

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
apt:
3939
update_cache: true
4040
cache_valid_time: 3600
41+
register: apt_status
42+
until: apt_status is success
43+
delay: 5
44+
retries: 3
4145
environment: "{{ proxy_env | default({}) }}"
4246
when: ansible_os_family == "Debian" and installation_method == "repo"
4347

@@ -47,6 +51,10 @@
4751
- gnupg
4852
- apt-transport-https
4953
state: present
54+
register: apt_status
55+
until: apt_status is success
56+
delay: 5
57+
retries: 3
5058
environment: "{{ proxy_env | default({}) }}"
5159
when: ansible_os_family == "Debian" and installation_method == "repo"
5260

config_pgcluster.yml

+8
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
apt:
6363
update_cache: true
6464
cache_valid_time: 3600
65+
register: apt_status
66+
until: apt_status is success
67+
delay: 5
68+
retries: 3
6569
environment: "{{ proxy_env | default({}) }}"
6670
when: ansible_os_family == "Debian" and installation_method == "repo"
6771
tags: add_repo, install_packages, install_postgres
@@ -72,6 +76,10 @@
7276
- gnupg
7377
- apt-transport-https
7478
state: present
79+
register: apt_status
80+
until: apt_status is success
81+
delay: 5
82+
retries: 3
7583
environment: "{{ proxy_env | default({}) }}"
7684
when: ansible_os_family == "Debian" and installation_method == "repo"
7785
tags: add_repo, install_packages, install_postgres

consul.yml

+12
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
apt:
4747
update_cache: true
4848
cache_valid_time: 3600
49+
register: apt_status
50+
until: apt_status is success
51+
delay: 5
52+
retries: 3
4953
when: ansible_os_family == "Debian" and installation_method == "repo"
5054

5155
- name: Make sure the gnupg and apt-transport-https packages are present
@@ -54,12 +58,20 @@
5458
- gnupg
5559
- apt-transport-https
5660
state: present
61+
register: apt_status
62+
until: apt_status is success
63+
delay: 5
64+
retries: 3
5765
when: ansible_os_family == "Debian" and installation_method == "repo"
5866

5967
- name: Make sure the python3-pip package are present
6068
package:
6169
name: python3-pip
6270
state: present
71+
register: package_status
72+
until: package_status is success
73+
delay: 5
74+
retries: 3
6375

6476
- name: Build a firewall_ports_dynamic_var
6577
set_fact:

deploy_pgcluster.yml

+16
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
apt:
6464
update_cache: true
6565
cache_valid_time: 3600
66+
register: apt_status
67+
until: apt_status is success
68+
delay: 5
69+
retries: 3
6670
when: ansible_os_family == "Debian"
6771

6872
- name: Make sure the gnupg and apt-transport-https packages are present
@@ -71,19 +75,31 @@
7175
- gnupg
7276
- apt-transport-https
7377
state: present
78+
register: apt_status
79+
until: apt_status is success
80+
delay: 5
81+
retries: 3
7482
when: ansible_os_family == "Debian"
7583

7684
# Ansible requires the iproute package for network facts to be populated
7785
- name: Make sure that the iproute is installed
7886
package:
7987
name: iproute
8088
state: present
89+
register: package_status
90+
until: package_status is success
91+
delay: 5
92+
retries: 3
8193
when: ansible_os_family == "RedHat"
8294

8395
- name: Make sure that the iproute is installed
8496
apt:
8597
name: iproute2
8698
state: present
99+
register: apt_status
100+
until: apt_status is success
101+
delay: 5
102+
retries: 3
87103
when: ansible_os_family == "Debian"
88104

89105
- import_playbook: etcd_cluster.yml

etcd_cluster.yml

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
apt:
2727
update_cache: true
2828
cache_valid_time: 3600
29+
register: apt_status
30+
until: apt_status is success
31+
delay: 5
32+
retries: 3
2933
environment: "{{ proxy_env | default({}) }}"
3034
when: ansible_os_family == "Debian" and installation_method == "repo"
3135

@@ -35,6 +39,10 @@
3539
- gnupg
3640
- apt-transport-https
3741
state: present
42+
register: apt_status
43+
until: apt_status is success
44+
delay: 5
45+
retries: 3
3846
environment: "{{ proxy_env | default({}) }}"
3947
when: ansible_os_family == "Debian" and installation_method == "repo"
4048

roles/add-repository/tasks/main.yml

+16
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
package:
3636
name: epel-release
3737
state: absent
38+
register: package_status
39+
until: package_status is success
40+
delay: 5
41+
retries: 3
3842
when: install_epel_repo|bool
3943
tags: install_epel_repo
4044

@@ -52,6 +56,10 @@
5256
name: "/tmp/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
5357
state: present
5458
disable_gpg_check: true
59+
register: package_status
60+
until: package_status is success
61+
delay: 5
62+
retries: 3
5563
when: install_epel_repo|bool
5664
tags: install_epel_repo
5765

@@ -60,6 +68,10 @@
6068
package:
6169
name: centos-release-scl-rh
6270
state: present
71+
register: package_status
72+
until: package_status is success
73+
delay: 5
74+
retries: 3
6375
when: install_scl_repo|bool and
6476
(ansible_distribution == 'CentOS' and
6577
ansible_distribution_major_version == '7')
@@ -147,6 +159,10 @@
147159
name: /tmp/pgdg-redhat-repo-latest.noarch.rpm
148160
state: present
149161
disable_gpg_check: true
162+
register: package_status
163+
until: package_status is success
164+
delay: 5
165+
retries: 3
150166
when: install_postgresql_repo|bool
151167
tags: install_postgresql_repo
152168
environment: "{{ proxy_env | default({}) }}"

roles/ansible-role-firewall/tasks/main.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
---
22

33
- name: Ensure iptables is present.
4-
package: name=iptables state=present
4+
package:
5+
name: iptables
6+
state: present
7+
register: package_status
8+
until: package_status is success
9+
delay: 5
10+
retries: 3
511

612
- name: Flush iptables the first time playbook runs.
713
command: >

roles/consul/tasks/dnsmasq.yml

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
package:
66
name: "{{ dnsmasq_package }}"
77
state: present
8+
register: package_status
9+
until: package_status is success
10+
delay: 5
11+
retries: 3
812
become: true
913
tags: dnsmasq, installation
1014

roles/consul/tasks/install.yml

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
package:
66
name: "{{ consul_os_packages }}"
77
state: present
8+
register: package_status
9+
until: package_status is success
10+
delay: 5
11+
retries: 3
812
tags: installation
913
when: not ansible_facts['os_family'] == "VMware Photon OS" and (consul_os_packages | length > 0)
1014

roles/consul/tasks/install_linux_repo.yml

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
package:
66
name: "{{ consul_repo_prerequisites }}"
77
state: present
8+
register: package_status
9+
until: package_status is success
10+
delay: 5
11+
retries: 3
812
become: true
913
when: (consul_os_repo_prerequisites)
1014
tags: installation
@@ -77,6 +81,10 @@
7781
package:
7882
name: "consul{{ '=' if ansible_pkg_mgr == 'apt' else '-' }}{{ consul_version }}"
7983
state: present
84+
register: package_status
85+
until: package_status is success
86+
delay: 5
87+
retries: 3
8088
become: true
8189

8290
- name: Create a directory /etc/systemd/system/consul.service.d

roles/consul/tasks/install_remote.yml

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
package:
66
name: "{{ consul_os_packages }}"
77
state: present
8+
register: package_status
9+
until: package_status is success
10+
delay: 5
11+
retries: 3
812
tags: installation
913

1014
- name: Validate remote Consul directory

roles/consul/tasks/iptables.yml

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
- name: Install iptables
55
apt:
66
name: iptables
7+
register: apt_status
8+
until: apt_status is success
9+
delay: 5
10+
retries: 3
711

812
- name: Redirect local DNS (1/4)
913
iptables:

roles/consul/tasks/main.yml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
package:
1515
name: python3-pip
1616
state: present
17+
register: package_status
18+
until: package_status is success
19+
delay: 5
20+
retries: 3
1721
delegate_to: 127.0.0.1
1822
run_once: true
1923
ignore_errors: true

roles/etcd/tasks/main.yml

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
- unzip
1010
- tar
1111
state: present
12+
register: package_status
13+
until: package_status is success
14+
delay: 5
15+
retries: 3
1216
environment: "{{ proxy_env | default({}) }}"
1317
tags: etcd, etcd_install
1418

0 commit comments

Comments
 (0)