{"id":20811308,"url":"https://github.com/express42/pgbarman","last_synced_at":"2025-12-11T20:29:33.671Z","repository":{"id":66323606,"uuid":"51823216","full_name":"express42/pgbarman","owner":"express42","description":"Express 42 pgbarman cookbook","archived":false,"fork":false,"pushed_at":"2017-07-10T10:26:16.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-01-18T14:46:31.745Z","etag":null,"topics":["chef","cookbooks","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/express42.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-16T09:20:49.000Z","updated_at":"2017-05-02T10:36:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d01937d-3547-47b7-8b65-14456e2592db","html_url":"https://github.com/express42/pgbarman","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express42%2Fpgbarman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express42%2Fpgbarman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express42%2Fpgbarman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express42%2Fpgbarman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/express42","download_url":"https://codeload.github.com/express42/pgbarman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243158972,"owners_count":20245669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chef","cookbooks","postgresql"],"created_at":"2024-11-17T20:40:03.734Z","updated_at":"2025-12-11T20:29:28.618Z","avatar_url":"https://github.com/express42.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Chef cookbook](https://img.shields.io/cookbook/v/pgbarman.svg)](https://github.com/express42/pgbarman)\n[![Code Climate](https://codeclimate.com/github/express42-cookbooks/pgbarman/badges/gpa.svg)](https://codeclimate.com/github/express42-cookbooks/pgbarman)\n[![Build Status](https://travis-ci.org/express42/pgbarman.svg)](https://travis-ci.org/express42/pgbarman)\n\n# Description\nPgbarman cookbook for chef.\nInstalls and configure pgbarman - backup and recovery manager for PostgreSQL\n\n\n# Requirements\n\npgbarman package, at least 1.3.3 version\n\n## Platform:\n\n* Ubuntu 12.04+\n* Debian 6+\n\n\n# Attributes\n\n* `node['pgbarman']['packages']` -  Defaults to `\"%w(barman bzip2)\"`.\n* `node['pgbarman']['server']['servers_config_dir']` -  Defaults to `\"/etc/barman.d\"`.\n* `node['pgbarman']['server']['global_configuration']['barman_home']` -  Defaults to `\"/var/lib/barman\"`.\n* `node['pgbarman']['server']['global_configuration']['barman_lock_directory']` -  Defaults to `\"/var/run/barman\"`.\n* `node['pgbarman']['server']['global_configuration']['barman_user']` -  Defaults to `\"barman\"`.\n* `node['pgbarman']['server']['global_configuration']['log_file']` -  Defaults to `\"/var/log/barman/barman.log\"`.\n* `node['pgbarman']['server']['global_configuration']['compression']` -  Defaults to `\"bzip2\"`.\n* `node['pgbarman']['server']['global_configuration']['reuse_backup']` -  Defaults to `\"off\"`.\n* `node['pgbarman']['server']['global_configuration']['immediate_checkpoint']` -  Defaults to `\"true\"`.\n* `node['pgbarman']['server']['global_configuration']['basebackup_retry_times']` -  Defaults to `\"3\"`.\n* `node['pgbarman']['server']['global_configuration']['basebackup_retry_sleep']` -  Defaults to `\"30\"`.\n* `node['pgbarman']['server']['global_configuration']['retention_policy_mode']` -  Defaults to `\"auto\"`.\n* `node['pgbarman']['server']['global_configuration']['wal_retention_policy']` -  Defaults to `\"main\"`.\n* `node['pgbarman']['server']['global_configuration']['configuration_files_directory']` -  Defaults to `\"node['pgbarman']['server']['servers_config_dir']\"`.\n\n# Recipes\n\n* pgbarman::default\n\n# Resources\n\n* [pgbarman_server](#pgbarman_server)\n* [pgbarman\\_bidirectional_ssh](#pgbarman\\_bidirectional_ssh)\n\n## pgbarman_server\n\n### Actions\n\n- create: creates pgbarman server configuration\n\n### Attribute Parameters\n\n- name: name of barman server\n- ssh_command: ssh conenction string for db server\n- pg_conninfo: postgres connection string\n- retention_policy: retention\n- additional_parameters: additional barman paramters, see ```man 5 barman``` for server configuration details\n\n## pgbarman\\_bidirectional_ssh\n\n### Actions\n\n- create: creates private key and authorized_keys configuration  for bidirect ssh connections between barman and db servers\n\n### Attribute Parameters\n\n- name: name of barman server\n- granted_user: destination user, who receives private key for authentication and authorized_keys for connection\n- ssh_folder_path: path to ssh folder\n- ssh_private_key: private key to use for auth\n- ssh_public_keys: array of public keys from which allow to authenticate\n\n\n# Examples\n```\ndb_server = 'db01.example.org'\npgbarman_server db_server do\n  ssh_command \"ssh postgres@#{db_server}\"\n  pg_conninfo \"host=#{db_server} user=postgres\"\n  retention_policy 'RECOVERY WINDOW OF 14 DAYS'\n  additional_parameters(\n    network_compression: 'True',\n    reuse_backup: 'link'\n  )\nend\n```\nlwrp examples to generate private key for barman and sets public key from db01/02 to allow bidirectional connect between servers\n\n```\npgbarman_bidirectional_ssh 'barman' do\n  granted_user 'barman'\n  ssh_folder_path '/var/lib/barman/.ssh'\n  ssh_private_key 'barman_private_ssh_key'\n  ssh_public_keys ['public_db01_key', 'public_db02_key']\nend\n\npgbarman_bidirectional_ssh 'db01' do\n  granted_user 'barman'\n  ssh_folder_path '/var/lib/barman/.ssh'\n  ssh_private_key 'db01_private_ssh_key'\n  ssh_public_keys ['public_barman_key']\nend\n\n\npgbarman_bidirectional_ssh 'db02' do\n  granted_user 'barman'\n  ssh_folder_path '/var/lib/barman/.ssh'\n  ssh_private_key 'db02_private_ssh_key'\n  ssh_public_keys ['public_barman_key']\nend\n\n```\nYou can find more examples in [tests](https://github.com/express42-cookbooks/pgbarman/tree/master/templates/default/server)\n\n# ToDo\n\n# License and Maintainer\n\nMaintainer:: LLC Express 42 (cookbooks@express42.com)\n\nLicense:: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpress42%2Fpgbarman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpress42%2Fpgbarman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpress42%2Fpgbarman/lists"}