File tree 12 files changed +29
-19
lines changed
12 files changed +29
-19
lines changed Original file line number Diff line number Diff line change @@ -108,14 +108,22 @@ Ansible ([What is Ansible](https://www.ansible.com/resources/videos/quick-start-
108
108
109
109
4 . Edit the variable file vars/[ main.yml] ( ./vars/main.yml )
110
110
111
+ ` vim vars/main.yml `
112
+
111
113
###### Minimum set of variables:
114
+ - ` proxy_env ` (for offline installation)
115
+
116
+ example:
117
+ ```
118
+ proxy_env:
119
+ http_proxy: http://proxy_server_ip:port
120
+ https_proxy: http://proxy_server_ip:port
121
+ ```
112
122
- ` cluster_vip `
113
123
- ` patroni_cluster_name `
114
124
- ` with_haproxy_load_balancing ` ` 'true' ` (Type A) or ` 'false' ` /default (Type B)
115
125
- ` postgresql_version `
116
- - ` proxy_env ` (if required)
117
126
118
- ` vim vars/main.yml `
119
127
120
128
5 . Run playbook:
121
129
Original file line number Diff line number Diff line change 14
14
state : present
15
15
update_cache : yes
16
16
loop : " {{ apt_repository }}"
17
- environment : " {{ proxy_env | default(omit ) }}"
17
+ environment : ' {{ proxy_env | default({} ) }}'
18
18
when : ansible_os_family == "Debian"
19
19
tags : add_repo
20
20
62
62
state : present
63
63
when : install_postgresql_repo == "true"
64
64
tags : install_postgresql_repo
65
- environment : " {{ proxy_env | default(omit ) }}"
65
+ environment : ' {{ proxy_env | default({} ) }}'
66
66
when : ansible_os_family == "RedHat"
67
67
tags : add_repo
Original file line number Diff line number Diff line change 7
7
mode : u+x,g+x,o+x
8
8
timeout : 30
9
9
validate_certs : no
10
- environment : " {{ proxy_env | default(omit ) }}"
10
+ environment : ' {{ proxy_env | default({} ) }}'
11
11
tags : [ get_confd, confd ]
12
12
13
13
- name : confd | create conf directories
Original file line number Diff line number Diff line change 6
6
dest : /tmp/
7
7
remote_src : yes
8
8
validate_certs : no
9
- environment : " {{ proxy_env | default(omit ) }}"
9
+ environment : ' {{ proxy_env | default({} ) }}'
10
10
11
11
- name : etcd cluster | copy "etcd" and "etcdctl" binary files to /usr/local/bin/
12
12
copy :
Original file line number Diff line number Diff line change 55
55
- openssl-libs
56
56
- systemd-devel
57
57
when : ansible_os_family == "RedHat"
58
- environment : " {{ proxy_env | default(omit ) }}"
58
+ environment : ' {{ proxy_env | default({} ) }}'
59
59
60
60
- name : haproxy | add haproxy group
61
61
group :
Original file line number Diff line number Diff line change 3
3
- name : keepalived | install packages
4
4
package :
5
5
name : keepalived
6
- environment : " {{ proxy_env | default(omit ) }}"
6
+ environment : ' {{ proxy_env | default({} ) }}'
7
7
tags : [ keepalived_install, keepalived ]
8
8
9
9
- name : keepalived | make sure the kernel parameters "net.ipv4.ip_nonlocal_bind", "net.ipv4.ip_forward" are enabled
Original file line number Diff line number Diff line change 3
3
- name : ntp | install package
4
4
package :
5
5
name : ntp
6
- environment : " {{ proxy_env | default(omit ) }}"
6
+ environment : ' {{ proxy_env | default({} ) }}'
7
7
tags : [ ntp_install, ntp ]
8
8
9
9
- name : ntp | copy the ntp.conf template file
Original file line number Diff line number Diff line change 5
5
package :
6
6
name : " {{ item }}"
7
7
loop : " {{ system_packages }}"
8
- environment : " {{ proxy_env | default(omit ) }}"
8
+ environment : ' {{ proxy_env | default({} ) }}'
9
9
tags : install_packages
10
10
11
11
# PostgreSQL prepare for install (for Debian based only)
14
14
package :
15
15
name : postgresql-common
16
16
state : present
17
- environment : " {{ proxy_env | default(omit ) }}"
17
+ environment : ' {{ proxy_env | default({} ) }}'
18
18
19
19
- name : disable initializing of a default postgresql cluster
20
20
replace :
34
34
package :
35
35
name : " {{ item }}"
36
36
loop : " {{ postgresql_packages }}"
37
- environment : " {{ proxy_env | default(omit ) }}"
37
+ environment : ' {{ proxy_env | default({} ) }}'
38
38
when : postgresql_exists != "true"
39
39
tags : install_postgres
Original file line number Diff line number Diff line change 48
48
name : urllib3<1.25
49
49
executable : /usr/local/bin/pip3
50
50
extra_args : " --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org"
51
- environment : " {{ proxy_env | default(omit ) }}"
51
+ environment : ' {{ proxy_env | default({} ) }}'
52
52
tags : [ patroni, patroni_install ]
53
53
54
54
- name : Patroni | create conf directory
Original file line number Diff line number Diff line change 3
3
- name : PgBouncer | install package
4
4
package :
5
5
name : pgbouncer
6
- environment : " {{ proxy_env | default(omit ) }}"
6
+ environment : ' {{ proxy_env | default({} ) }}'
7
7
tags : [ pgbouncer_install, pgbouncer ]
8
8
9
9
- name : PgBouncer | ensure config directory "{{ pgbouncer_conf_dir }}" exist
Original file line number Diff line number Diff line change 15
15
command : python3 get-pip.py --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org
16
16
args :
17
17
chdir : /tmp/
18
- environment : " {{ proxy_env | default(omit ) }}"
18
+ environment : ' {{ proxy_env | default({} ) }}'
19
19
tags : [ pip_install, pip ]
Original file line number Diff line number Diff line change 1
1
---
2
+ # Proxy variables (for offline installation)
3
+ proxy_env : {}
4
+ # http_proxy: http://10.128.64.9:3128
5
+ # https_proxy: http://10.128.64.9:3128
6
+
7
+ # -------------------------------------------
2
8
3
9
# Cluster variables
4
10
cluster_vip : " 10.128.64.145" # for client access to databases in the cluster
@@ -158,10 +164,6 @@ pgbouncer_users:
158
164
159
165
160
166
# System variables
161
- proxy_env : []
162
- # http_proxy: http://10.128.64.9:3128
163
- # https_proxy: http://10.128.64.9:3128
164
-
165
167
ntp_enabled : ' false' # specify 'true' if you want to install and configure the ntp service
166
168
ntp_servers : []
167
169
# - "10.128.64.44"
You can’t perform that action at this time.
0 commit comments