Skip to content

Commit

Permalink
Install pg_repack to all databases
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Sep 13, 2024
1 parent 67b1da7 commit 3c36609
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ansible/roles/postgres/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@
- role::postgres
notify:
- Reload the postgres service

- name: Install and configure pg_repack
include_tasks: pg_repack.yml
21 changes: 21 additions & 0 deletions ansible/roles/postgres/tasks/pg_repack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Install pg_repack
apt:
name:
- postgresql-{{ postgres_version }}-repack
state: present
tags:
- role::postgres
- role::postgres-pg_repack

- name: Add pg_repack to all databases
become: true
become_user: "{{ postgres_user }}"
community.postgresql.postgresql_ext:
db: "{{ item.name }}"
name: pg_repack
state: present
loop: "{{ postgres_databases }}"
tags:
- role::postgres
- role::postgres-pg_repack

0 comments on commit 3c36609

Please sign in to comment.