Files
configpolicy/roles/postgresql-server-base/tasks/main.yml
Dustin C. Hatch e861883627 r/pgsql-server-base: Add post-upgrade capability
The `postgresql-upgrade` script will now run any executables located in
the `/etc/postgresql/post-upgrade.d` directory.  This will allow making
arbitrary changes to the system after a PostgreSQL major version
upgrade.  Notably, we will use this capability to change the WAL-G
configuration to upload WAL archives and backups to the correct
version-specific location.
2024-11-17 10:27:31 -06:00

49 lines
1.0 KiB
YAML

- name: ensure postgresql-server is installed
package:
name:
- postgresql-server
- postgresql-upgrade
state: present
tags:
- install
- name: ensure postgresql-upgrade script is installed
copy:
src: postgresql-upgrade.sh
dest: /usr/local/libexec/postgresql-upgrade
owner: root
group: root
mode: u=rwx,go=rx
tags:
- postgresql-upgrade
- name: ensure postgresql-upgrade systemd unit is installed
copy:
src: postgresql-upgrade.service
dest: /etc/systemd/system/postgresql-upgrade.service
owner: root
group: root
mode: u=rw,go=r
notify:
- reload systemd
tags:
- postgresql-upgrade
- systemd
- name: ensure postgresql post-upgrade directory exists
file:
path: /etc/postgresql/post-upgrade.d
owner: root
group: root
mode: u=rwx,go=rx
state: directory
tags:
- postgresql-upgrade
- name: ensure postgresql-upgrade service starts when needed
service:
name: postgresql-upgrade
enabled: true
tags:
- postgresql-upgrade
- service