Fix the data directory setup on EL systems.
This commit is contained in:
parent
3aeea4004a
commit
488253a708
|
@ -35,6 +35,9 @@
|
||||||
ansible.builtin.yum:
|
ansible.builtin.yum:
|
||||||
pkg: "{{ psql_el_pgdg_packages }}"
|
pkg: "{{ psql_el_pgdg_packages }}"
|
||||||
state: present
|
state: present
|
||||||
|
- name: postgresql-packages | Print the DATA directory
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "Postgresql data directory: {{ psql_el_data_dir }}"
|
||||||
|
|
||||||
- name: postgresql-packages | Create the postgresql data directory if it is not in the default place
|
- name: postgresql-packages | Create the postgresql data directory if it is not in the default place
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
@ -43,9 +46,25 @@
|
||||||
group: postgres
|
group: postgres
|
||||||
mode: "700"
|
mode: "700"
|
||||||
state: directory
|
state: directory
|
||||||
when:
|
when: psql_use_alternate_data_dir
|
||||||
- psql_use_alternate_data_dir
|
|
||||||
- ansible_distribution_file_variety == "RedHat"
|
- name: postgresql-packages | Crate a systemd directory to customize the postgresql startup unit
|
||||||
|
ansible.builtin.file:
|
||||||
|
dest: "/etc/systemd/system/postgresql-{{ psql_version }}.service.d"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "755"
|
||||||
|
state: directory
|
||||||
|
when: psql_use_alternate_data_dir
|
||||||
|
|
||||||
|
- name: postgresql-packages | Crate a postgresql systemd unit environment file
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: postgresql-service-environment.conf.j2
|
||||||
|
dest: "/etc/systemd/system/postgresql-{{ psql_version }}.service.d/environment.conf"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "644"
|
||||||
|
when: psql_use_alternate_data_dir
|
||||||
|
|
||||||
- name: postgresql-packages | Init the db if needed on EL systems
|
- name: postgresql-packages | Init the db if needed on EL systems
|
||||||
ansible.builtin.command: /usr/pgsql-{{ psql_version }}/bin/postgresql-{{ psql_version }}-setup initdb
|
ansible.builtin.command: /usr/pgsql-{{ psql_version }}/bin/postgresql-{{ psql_version }}-setup initdb
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Environment=PGDATA="{{ psql_el_data_dir }}"
|
Loading…
Reference in New Issue