Skip to content

Commit e496a25

Browse files
committed
move OS-specific variables to include_vars
fixed: skipping vars_file 'vars/{{ ansible_os_family }}.yml' due to an undefined variable
1 parent e5f71a6 commit e496a25

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

add_balancer.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
vars_files:
1111
- vars/main.yml
1212
- vars/system.yml
13-
- "vars/{{ ansible_os_family }}.yml"
1413
vars:
1514
add_balancer: true
1615

1716
pre_tasks:
17+
- name: Include OS-specific variables
18+
include_vars: "vars/{{ ansible_os_family }}.yml"
19+
1820
- name: Checking Linux distribution
1921
fail:
2022
msg: "{{ ansible_distribution }} is not supported"

add_pgnode.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
vars_files:
1111
- vars/main.yml
1212
- vars/system.yml
13-
- "vars/{{ ansible_os_family }}.yml"
1413

1514
pre_tasks:
15+
- name: Include OS-specific variables
16+
include_vars: "vars/{{ ansible_os_family }}.yml"
17+
1618
- name: Checking Linux distribution
1719
fail:
1820
msg: "{{ ansible_distribution }} is not supported"
@@ -84,7 +86,9 @@
8486
any_errors_fatal: true
8587
vars_files:
8688
- vars/main.yml
87-
- "vars/{{ ansible_os_family }}.yml"
89+
pre_tasks:
90+
- name: Include OS-specific variables
91+
include_vars: "vars/{{ ansible_os_family }}.yml"
8892
roles:
8993
- role: pgbackrest
9094
when: pgbackrest_install|bool
@@ -97,10 +101,13 @@
97101
vars_files:
98102
- vars/main.yml
99103
- vars/system.yml
100-
- "vars/{{ ansible_os_family }}.yml"
101104
vars:
102105
existing_pgcluster: true
103106

107+
pre_tasks:
108+
- name: Include OS-specific variables
109+
include_vars: "vars/{{ ansible_os_family }}.yml"
110+
104111
roles:
105112
- role: wal-g
106113
when: wal_g_install|bool

balancers.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
vars_files:
1010
- vars/main.yml
1111
- vars/system.yml
12-
- "vars/{{ ansible_os_family }}.yml"
1312
vars:
1413
vip_manager_disable: false # or 'true' for disable vip-manager service (if installed)
1514

1615
pre_tasks:
16+
- name: Include OS-specific variables
17+
include_vars: "vars/{{ ansible_os_family }}.yml"
18+
1719
- name: Checking Linux distribution
1820
fail:
1921
msg: "{{ ansible_distribution }} is not supported"

deploy_pgcluster.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
vars_files:
2727
- vars/main.yml
2828
- vars/system.yml
29-
- "vars/{{ ansible_os_family }}.yml"
3029

3130
pre_tasks:
31+
- name: Include OS-specific variables
32+
include_vars: "vars/{{ ansible_os_family }}.yml"
33+
3234
- name: Checking Linux distribution
3335
fail:
3436
msg: "{{ ansible_distribution }} is not supported"
@@ -106,7 +108,9 @@
106108
any_errors_fatal: true
107109
vars_files:
108110
- vars/main.yml
109-
- "vars/{{ ansible_os_family }}.yml"
111+
pre_tasks:
112+
- name: Include OS-specific variables
113+
include_vars: "vars/{{ ansible_os_family }}.yml"
110114
roles:
111115
- role: pgbackrest
112116
when: pgbackrest_install|bool
@@ -119,7 +123,10 @@
119123
vars_files:
120124
- vars/main.yml
121125
- vars/system.yml
122-
- "vars/{{ ansible_os_family }}.yml"
126+
127+
pre_tasks:
128+
- name: Include OS-specific variables
129+
include_vars: "vars/{{ ansible_os_family }}.yml"
123130

124131
roles:
125132
- role: wal-g

etcd_cluster.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
vars_files:
1010
- vars/main.yml
1111
- vars/system.yml
12-
- "vars/{{ ansible_os_family }}.yml"
1312

1413
pre_tasks:
14+
- name: Include OS-specific variables
15+
include_vars: "vars/{{ ansible_os_family }}.yml"
16+
1517
- name: Update apt cache
1618
apt:
1719
update_cache: true

0 commit comments

Comments
 (0)