Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add playbook to cleanup pg_repack on pgbouncer_a6 #6278

Merged
merged 3 commits into from
May 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/commcare_cloud/ansible/cleanup_pg_repack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
- name: Cleanup pg_repack configuration
hosts: pgbouncer_a6
tasks:
- include_vars:
file: roles/postgresql_base/defaults/main.yml

- name: Check if pg_repack is installed
stat:
path: "{{ postgres_install_dir }}/bin/pg_repack"
register: pg_repack_stat

- name: Display if pg_repack is installed
debug:
msg: "pg_repack is installed"
when: pg_repack_stat.stat.exists == True

- name: Check if pg_repack cron exists
stat:
path: "/etc/cron.d/pg_repack_commcarehq_synclogs"
register: pg_repack_cron

- name: Display if pg_repack cron exists
debug:
msg: "pg_repack cron is configured"
when: pg_repack_cron.stat.exists == True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Is this task necessary? The next Remove pg_repack cron file task should tell you if it existed by its "changed" state.

Copy link
Contributor Author

@gherceg gherceg May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope was just useful for debugging. I removed the two tasks that are no longer needed. 9202b99


- name: Remove pg_repack cron file
file:
path: "/etc/cron.d/pg_repack_commcarehq_synclogs"
state: absent
Loading