Skip to content

Commit d549931

Browse files
authored
Merge pull request #41 from coopdevs/fix-db-backups
Grant USAGE on public schema
2 parents 15ffcc0 + cbe1114 commit d549931

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ script:
2020
# Check the role/playbook's syntax.
2121
- ansible-galaxy install paulfantom.restic
2222
- ansible-playbook -i tests/inventory tests/test.yml --syntax-check
23-
- ansible-lint .
23+
- ansible-lint tasks/ handlers/
2424
- yamllint -c .yamllint.yaml .
2525

2626
webhooks: https://galaxy.ansible.com/api/v1/notifications/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Fixed
10+
- Ensure the backups user has USAGE privilage on the database's schema. We assume it to be`public` #41.
11+
912
## [v1.2.6] - 2020-01-23
1013
### Fixed
1114
- When using default backups-prepare script, manage the case when no assets_paths are defined.

tasks/main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@
5151
with_items: "{{ backups_role_db_names }}"
5252
when: _backups_role_postgresql_enabled
5353

54+
- name: Grant USAGE priv on public schema
55+
postgresql_privs:
56+
db: "{{ backups_role_db_names[0] }}"
57+
role: "{{ backups_role_postgresql_user_name }}"
58+
privs: USAGE
59+
type: schema
60+
objs: public
61+
become: true
62+
become_user: "{{ postgresql_user }}"
63+
when: _backups_role_postgresql_enabled
64+
5465
- name: Include taskfile for postgresql privileges
5566
include_tasks: postgresql_privs.yml
5667
loop: "{{ backups_role_db_names }}"

0 commit comments

Comments
 (0)