-
-
Notifications
You must be signed in to change notification settings - Fork 174
/
Copy pathsetup-docker.yml
80 lines (70 loc) · 2.22 KB
/
setup-docker.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
74
75
76
77
78
79
80
- name: Copy extension packages
copy:
src: files/extensions/
dest: /tmp/extensions/
when: debpkg_mode
# Builtin apt module does not support wildcard for deb paths
- name: Install extensions
shell: |
set -e
apt-get update
apt-get install -y --no-install-recommends /tmp/extensions/*.deb
when: debpkg_mode
- name: pgsodium - determine postgres bin directory
shell: pg_config --bindir
register: pg_bindir_output
when: debpkg_mode
- set_fact:
pg_bindir: "{{ pg_bindir_output.stdout }}"
when: debpkg_mode
- name: pgsodium - set pgsodium.getkey_script
become: yes
lineinfile:
path: /etc/postgresql/postgresql.conf
state: present
# script is expected to be placed by finalization tasks for different target platforms
line: pgsodium.getkey_script= '{{ pg_bindir }}/pgsodium_getkey.sh'
when: debpkg_mode
# supautils
- name: supautils - add supautils to session_preload_libraries
become: yes
replace:
path: /etc/postgresql/postgresql.conf
regexp: "#session_preload_libraries = ''"
replace: session_preload_libraries = 'supautils'
when: debpkg_mode or stage2_nix
- name: supautils - write custom supautils.conf
template:
src: "files/postgresql_config/supautils.conf.j2"
dest: /etc/postgresql-custom/supautils.conf
mode: 0664
owner: postgres
group: postgres
when: debpkg_mode or stage2_nix
- name: supautils - copy extension custom scripts
copy:
src: files/postgresql_extension_custom_scripts/
dest: /etc/postgresql-custom/extension-custom-scripts
become: yes
when: debpkg_mode or stage2_nix
- name: supautils - chown extension custom scripts
file:
mode: 0775
owner: postgres
group: postgres
path: /etc/postgresql-custom/extension-custom-scripts
recurse: yes
become: yes
when: debpkg_mode or stage2_nix
- name: supautils - include /etc/postgresql-custom/supautils.conf in postgresql.conf
become: yes
replace:
path: /etc/postgresql/postgresql.conf
regexp: "#include = '/etc/postgresql-custom/supautils.conf'"
replace: "include = '/etc/postgresql-custom/supautils.conf'"
when: debpkg_mode or stage2_nix
- name: Cleanup - extension packages
file:
path: /tmp/extensions
state: absent
when: debpkg_mode