Skip to content

libre-ops/wal2json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wal2json provisioning role

This is an Ansible role for provisioning Wal2json, a postgresql plugin for Change Data Capture that converts database changes into json diffs.

Defaults

Check out all the defaults here.

The default Postgresql variables are geared towards Debian/Ubuntu and Postgres 10, but can be overridden as needed:

postgresql_version: "10"
postgresql_bin_path: "/usr/lib/postgresql/{{ postgresql_version }}/bin"
postgresql_config_path: "/etc/postgresql/{{ postgresql_version }}/main"

Building from source

To fetch wal2json from the github repo and build it from source, use: wal2json_build_from_source: true.

Caution with shared_preload_libraries

By default this role will write some config settings to a postgres conf.d file, including setting shared_preload_libraries = 'wal2json'. If you use other postgres libraries in your app, you should use: wal2json_set_preload_libraries: false and include 'wal2json' in your postgresql.conf file separately, eg: shared_preload_libraries = 'some_other_library,wal2json'.

Setting the same value twice in your configs can cause postgres to stop working, so be careful to avoid duplication.

Example playbook

- name: Provision wal2json
  hosts: webservers

  roles:
    - role: libre_ops.wal2json
      vars:
        postgresql_version: 11