Skip to content

Commit 4c699df

Browse files
committed
Rename pg_data_mount variables to postgresql_data_dir_mount
Replaces all instances of pg_data_mount_path and pg_data_mount_fstype with postgresql_data_dir_mount_path and postgresql_data_dir_mount_fstype across playbooks, roles, and UI code for consistency and clarity in variable naming.
1 parent dd20452 commit 4c699df

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

automation/playbooks/remove_cluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
default_postgresql_cluster_name: "{{ 'main' if ansible_os_family == 'Debian' else 'data' }}"
3030
default_postgresql_data_dir: "\
3131
{% if cloud_provider | default('') | length > 0 %}\
32-
{{ pg_data_mount_path | default('/pgdata') }}/{{ default_postgresql_version }}/{{ default_postgresql_cluster_name }}\
32+
{{ postgresql_data_dir_mount_path | default('/pgdata') }}/{{ default_postgresql_version }}/{{ default_postgresql_cluster_name }}\
3333
{% else %}\
3434
{{ default_postgresql_home_dir }}/{{ default_postgresql_version }}/{{ default_postgresql_cluster_name }}\
3535
{% endif %}"

automation/playbooks/remove_node.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
default_postgresql_cluster_name: "{{ 'main' if ansible_os_family == 'Debian' else 'data' }}"
9090
default_postgresql_data_dir: "\
9191
{% if cloud_provider | default('') | length > 0 %}\
92-
{{ pg_data_mount_path | default('/pgdata') }}/{{ default_postgresql_version }}/{{ default_postgresql_cluster_name }}\
92+
{{ postgresql_data_dir_mount_path | default('/pgdata') }}/{{ default_postgresql_version }}/{{ default_postgresql_cluster_name }}\
9393
{% else %}\
9494
{{ default_postgresql_home_dir }}/{{ default_postgresql_version }}/{{ default_postgresql_cluster_name }}\
9595
{% endif %}"

automation/roles/common/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ postgresql_home_dir: "{{ '/var/lib/postgresql' if ansible_os_family == 'Debian'
259259
# You can specify custom data dir path. Example: "/pgdata/{{ postgresql_version }}/main"
260260
postgresql_data_dir: "\
261261
{% if cloud_provider | default('') | length > 0 %}\
262-
{{ pg_data_mount_path | default('/pgdata') }}/{{ postgresql_version }}/{{ postgresql_cluster_name }}\
262+
{{ postgresql_data_dir_mount_path | default('/pgdata') }}/{{ postgresql_version }}/{{ postgresql_cluster_name }}\
263263
{% else %}\
264264
{{ postgresql_home_dir }}/{{ postgresql_version }}/{{ postgresql_cluster_name }}\
265265
{% endif %}"

automation/roles/mount/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ This role configures filesystems and mount points:
1414
| mount[].fstype | "ext4" | Filesystem type (e.q., ext4, xfs). Use "zfs" to create a zpool and mount it. |
1515
| mount[].opts | "defaults,noatime" | Mount options (not applicable to zfs creation). |
1616
| mount[].state | "mounted" | Desired state (mounted, present, absent, etc.). |
17-
| pg_data_mount_path | "/pgdata" | Default path used when auto-provisioning or for the ZFS mountpoint. |
18-
| pg_data_mount_fstype | "ext4" | Filesystem type to create when auto-provisioning the first disk. Set to "zfs" to create a zpool. |
17+
| postgresql_data_dir_mount_path | "/pgdata" | Default path used when auto-provisioning or for the ZFS mountpoint. |
18+
| postgresql_data_dir_mount_fstype | "ext4" | Filesystem type to create when auto-provisioning the first disk. Set to "zfs" to create a zpool. |
1919

2020
Notes:
2121
- The role relies on lsblk and jq for disk detection; ensure jq is available (it is installed by the common role by default).

automation/roles/mount/tasks/main.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
when: lsblk_disk.stdout is defined and lsblk_disk.stdout | length < 1
2727

2828
# Filesystem
29-
- name: Create "{{ pg_data_mount_fstype | default('ext4') }}" filesystem on the disk "/dev/{{ lsblk_disk.stdout | default('') }}"
29+
- name: Create "{{ postgresql_data_dir_mount_fstype | default('ext4') }}" filesystem on the disk "/dev/{{ lsblk_disk.stdout | default('') }}"
3030
community.general.filesystem:
3131
dev: "/dev/{{ lsblk_disk.stdout }}"
32-
fstype: "{{ pg_data_mount_fstype | default('ext4') }}"
32+
fstype: "{{ postgresql_data_dir_mount_fstype | default('ext4') }}"
3333
when:
3434
- (lsblk_disk.stdout is defined and lsblk_disk.stdout | length > 0)
35-
- ((pg_data_mount_fstype is defined and pg_data_mount_fstype != 'zfs') or
36-
(pg_data_mount_fstype is not defined and mount[0].fstype != 'zfs'))
35+
- ((postgresql_data_dir_mount_fstype is defined and postgresql_data_dir_mount_fstype != 'zfs') or
36+
(postgresql_data_dir_mount_fstype is not defined and mount[0].fstype != 'zfs'))
3737

3838
# UUID
3939
- name: Get UUID of the disk "/dev/{{ lsblk_disk.stdout | default('') }}"
@@ -46,30 +46,30 @@
4646
changed_when: false
4747
when:
4848
- (lsblk_disk.stdout is defined and lsblk_disk.stdout | length > 0)
49-
- ((pg_data_mount_fstype is defined and pg_data_mount_fstype != 'zfs') or
50-
(pg_data_mount_fstype is not defined and mount[0].fstype != 'zfs'))
49+
- ((postgresql_data_dir_mount_fstype is defined and postgresql_data_dir_mount_fstype != 'zfs') or
50+
(postgresql_data_dir_mount_fstype is not defined and mount[0].fstype != 'zfs'))
5151

5252
- name: "Set mount variables"
5353
ansible.builtin.set_fact:
5454
mount:
5555
- src: "UUID={{ lsblk_uuid.stdout }}"
56-
path: "{{ pg_data_mount_path | default('/pgdata', true) }}"
57-
fstype: "{{ pg_data_mount_fstype | default('ext4', true) }}"
56+
path: "{{ postgresql_data_dir_mount_path | default('/pgdata', true) }}"
57+
fstype: "{{ postgresql_data_dir_mount_fstype | default('ext4', true) }}"
5858
when: lsblk_uuid.stdout is defined
5959

6060
# Mount
6161
- name: Mount the filesystem
6262
ansible.posix.mount:
6363
path: "{{ item.path }}"
6464
src: "{{ item.src }}"
65-
fstype: "{{ item.fstype | default(pg_data_mount_fstype | default('ext4', true), true) }}"
65+
fstype: "{{ item.fstype | default(postgresql_data_dir_mount_fstype | default('ext4', true), true) }}"
6666
opts: "{{ item.opts | default('defaults,noatime') }}"
6767
state: "{{ item.state | default('mounted') }}"
6868
loop: "{{ mount }}"
6969
when:
7070
- (item.src | length > 0 and item.path | length > 0)
71-
- ((pg_data_mount_fstype is defined and pg_data_mount_fstype != 'zfs') or
72-
(pg_data_mount_fstype is not defined and item.fstype != 'zfs'))
71+
- ((postgresql_data_dir_mount_fstype is defined and postgresql_data_dir_mount_fstype != 'zfs') or
72+
(postgresql_data_dir_mount_fstype is not defined and item.fstype != 'zfs'))
7373

7474
# ZFS Pool (if fstype is 'zfs')
7575
- block:
@@ -150,10 +150,10 @@
150150
-O atime=off
151151
-O recordsize=128k
152152
-O logbias=throughput
153-
-m {{ pg_data_mount_path | default(mount[0].path | default('/pgdata', true), true) }}
153+
-m {{ postgresql_data_dir_mount_path | default(mount[0].path | default('/pgdata', true), true) }}
154154
pgdata {{ mount[0].src | default("/dev/" + lsblk_disk.stdout, true) }}
155155
when:
156156
- (mount[0].src | length > 0 or lsblk_disk.stdout | default('') | length > 0)
157-
- ((pg_data_mount_fstype is defined and pg_data_mount_fstype == 'zfs') or
158-
(pg_data_mount_fstype is not defined and mount[0].fstype == 'zfs'))
157+
- ((postgresql_data_dir_mount_fstype is defined and postgresql_data_dir_mount_fstype == 'zfs') or
158+
(postgresql_data_dir_mount_fstype is not defined and mount[0].fstype == 'zfs'))
159159
tags: mount, zpool

console/ui/src/shared/lib/clusterValuesTransformFunctions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const getCloudProviderExtraVars = (values: ClusterFormValues) => ({
7070
...values[CLUSTER_FORM_FIELD_NAMES.REGION_CONFIG].cloud_image.image,
7171
...(IS_EXPERT_MODE
7272
? {
73-
pg_data_mount_fstype: values[STORAGE_BLOCK_FIELDS.FILE_SYSTEM_TYPE],
73+
postgresql_data_dir_mount_fstype: values[STORAGE_BLOCK_FIELDS.FILE_SYSTEM_TYPE],
7474
volume_type: values[STORAGE_BLOCK_FIELDS.VOLUME_TYPE],
7575
database_public_access: !!values?.[ADDITIONAL_SETTINGS_BLOCK_FIELD_NAMES.IS_DB_PUBLIC_ACCESS],
7676
cloud_load_balancer: !!values?.[ADDITIONAL_SETTINGS_BLOCK_FIELD_NAMES.IS_CLOUD_LOAD_BALANCER],

0 commit comments

Comments
 (0)