ansible / ansible.builtin / v2.9.3 / module / postgresql_slot Add or remove replication slots from a PostgreSQL database | "added in version" 2.8 of ansible.builtin" Authors: John Scalia (@jscalia), Andrew Klychkov (@Andersson007) preview | supported by communityansible.builtin.postgresql_slot (v2.9.3) — module
pip
Install with pip install ansible==2.9.3
Add or remove physical or logical replication slots from a PostgreSQL database.
- name: Create physical_one physical slot if doesn't exist become_user: postgres postgresql_slot: slot_name: physical_one db: ansible
- name: Remove physical_one slot if exists become_user: postgres postgresql_slot: slot_name: physical_one db: ansible state: absent
- name: Create logical_one logical slot to the database acme if doesn't exist postgresql_slot: name: logical_slot_one slot_type: logical state: present output_plugin: custom_decoder_one db: "acme"
- name: Remove logical_one slot if exists from the cluster running on another host and non-standard port postgresql_slot: name: logical_one login_host: mydatabase.example.org port: 5433 login_user: ourSuperuser login_password: thePassword state: absent
db: aliases: - login_db description: - Name of database to connect to. type: str name: aliases: - slot_name description: - Name of the replication slot to add or remove. required: true type: str port: aliases: - login_port default: 5432 description: - Database port to connect to. type: int state: choices: - absent - present default: present description: - The slot state. - I(state=present) implies the slot must be present in the system. - I(state=absent) implies the I(groups) must be revoked from I(target_roles). type: str ca_cert: aliases: - ssl_rootcert description: - Specifies the name of a file containing SSL certificate authority (CA) certificate(s). - If the file exists, the server's certificate will be verified to be signed by one of these authorities. type: str ssl_mode: choices: - allow - disable - prefer - require - verify-ca - verify-full default: prefer description: - Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. - See U(https://www.postgresql.org/docs/current/static/libpq-ssl.html) for more information on the modes. - Default of C(prefer) matches libpq default. type: str slot_type: choices: - logical - physical default: physical description: - Slot type. type: str login_host: description: - Host running the database. - If you have connection issues when using C(localhost), try to use C(127.0.0.1) instead. type: str login_user: default: postgres description: - The username this module should use to establish its PostgreSQL session. type: str session_role: description: - Switch to session_role after connecting. The specified session_role must be a role that the current login_user is a member of. - Permissions checking for SQL commands is carried out as though the session_role were the one that had logged in originally. type: str output_plugin: default: test_decoding description: - All logical slots must indicate which output plugin decoder they're using. - This parameter does not apply to physical slots. - It will be ignored with I(slot_type=physical). type: str login_password: description: - The password this module should use to establish its PostgreSQL session. type: str login_unix_socket: description: - Path to a Unix domain socket for local connections. type: str immediately_reserve: default: false description: - Optional parameter that when C(yes) specifies that the LSN for this replication slot be reserved immediately, otherwise the default, C(no), specifies that the LSN is reserved on the first connection from a streaming replication client. - Is available from PostgreSQL version 9.6. - Uses only with I(slot_type=physical). - Mutually exclusive with I(slot_type=logical). type: bool
name: description: Name of the slot returned: always sample: physical_one type: str queries: description: List of executed queries. returned: always sample: - SELECT pg_create_physical_replication_slot('physical_one', False, False) type: str