This repository has been archived by the owner on Mar 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate_clips_user.yml
75 lines (63 loc) · 1.97 KB
/
create_clips_user.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
- hosts: localhost
connection: local
gather_facts: no
tasks:
- rds:
command: facts
instance_name: "{{ project_slug }}-database"
region: "{{ region }}"
register: database
- name: Make intake users have create and usage on public
postgresql_privs:
login_host: "{{ database.instance.endpoint }}"
login_user: "{{ pg_username }}"
login_password: "{{ pg_password }}"
db: intake
privs: CREATE,USAGE
type: schema
objs: public
roles: intake
- name: Make default users not have create and usage on public
postgresql_privs:
login_host: "{{ database.instance.endpoint }}"
login_user: "{{ pg_username }}"
login_password: "{{ pg_password }}"
db: intake
state: absent
privs: CREATE,USAGE
type: schema
objs: public
roles: public
- name: Create Clips User with Privacy Preserving Access
postgresql_user:
login_host: "{{ database.instance.endpoint }}"
login_user: "{{ pg_username }}"
login_password: "{{ pg_password }}"
db: intake
name: "clips"
password: "{{ pg_clips_password }}"
priv: "CONNECT"
role_attr_flags: NOSUPERUSER
no_password_changes: true
- name: Give Clips User permissions on Purged schema
postgresql_privs:
login_host: "{{ database.instance.endpoint }}"
login_user: "{{ pg_app_username }}"
login_password: "{{ pg_app_password }}"
db: intake
privs: USAGE
type: schema
objs: purged
roles: clips
- name: Grant Select on tables in purged schema
postgresql_privs:
login_host: "{{ database.instance.endpoint }}"
login_user: "{{ pg_app_username }}"
login_password: "{{ pg_app_password }}"
db: intake
privs: SELECT
type: table
objs: ALL_IN_SCHEMA
schema: purged
roles: clips