Skip to content

Commit

Permalink
fix: skip pg14 stuff if running pg13
Browse files Browse the repository at this point in the history
  • Loading branch information
BlacksilverConsulting authored Dec 2, 2024
1 parent 4c7952f commit f50cfdb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,19 @@
become: true
become_user: postgres

### TODO: Skip this if the source file doesn't exist
### (To work correctly with pg13.yaml)
- name: Check for PostgreSQL 14
ansible.builtin.stat:
path: /usr/lib/systemd/system/postgresql-14.service
register: pg14

- name: Add systemd service alias for PostgreSQL 14
# This is needed for application-specific automation
# that expects `service postgresql stop` to work
ansible.builtin.file:
src: /usr/lib/systemd/system/postgresql-14.service
state: link
path: /usr/lib/systemd/system/postgresql.service
when: pg14.stat.exists

### TODO Skip this if the source path doesn't exist
### (To work correctly with pg13.yaml)
Expand All @@ -71,6 +75,7 @@
state: link
src: /var/lib/pgsql/14/data
path: /var/lib/pgsql/data
when: pg14.stat.exists

- name: Create fake init.d file
# This is required for sysupdate 2005091601 to work correctly.
Expand Down

0 comments on commit f50cfdb

Please sign in to comment.