Skip to content

pgbackrest-toggle-archiving is not idempotent #17

@mbanck

Description

@mbanck

AFAICT, systemctl start pgbackrest-toggle-archiving@<cluster-name> turns archiving on or off, depending on the previous state.

That makes it really difficult to handle with Ansible, as running something like

- name: Enable pgBackrest archiving
  systemd:
    name: pgbackrest-toggle-archiving@{{ postgresql_cluster }}
    state: started

Will turn archiving on or off for each run, making the Ansible runs non-idempotent.

Is there a way to circumvent that? Conceptually, running systemctl enable/disable pgbackrest-archiving@<cluster-name> would be the best from a UX perspective, but systemd won't invoke the /usr/share/elephant-shed/pgbackrest-toggle-archiving script in this case but bail out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions