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 support for WAL shipping replication #11

Open
davidassigbi opened this issue Sep 13, 2024 · 0 comments
Open

Add support for WAL shipping replication #11

davidassigbi opened this issue Sep 13, 2024 · 0 comments
Assignees

Comments

@davidassigbi
Copy link
Contributor

davidassigbi commented Sep 13, 2024

Expected Behavior

Possibly include ssh key exchange for the postgres user

Current Behavior

Not supported ?

Possible Solution

 - name: Set archive_command fact
      ansible.builtin.set_fact:
        archive_command: >-
          rsync -e ssh -az %p {{ postgresql_ip_replica if postgresql_replication_role == 'primary' else postgresql_replication_primary_address }}:/var/lib/postgresql/archived_wal/{{ postgresql_version }}/main/%f ; rsync -a %p /var/lib/postgresql/archived_wal/{{ postgresql_version }}/main/%f

postgresql_global_config_options_extra:
[...]
  - option: archive_command
    value: "{{ archive_command }}"

# Crontab pour la purge des archive wal (si réplication par wal)
    - name: Add cron job to delete files older than 3 days from /var/lib/postgresql/archived_wal
      ansible.builtin.cron:
        name: "PURGE ARCHIVED WAL"
        minute: "0"
        hour: "0"
        day: "*"
        month: "*"
        weekday: "*"
        user: "root"
        job: "find /var/lib/postgresql/archived_wal -type f -mtime +3 -delete"

Steps to Reproduce (for bugs)

Context

Your Environment

  • Version used: 1.0.0
@nathaliereslou nathaliereslou self-assigned this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants