File tree Expand file tree Collapse file tree 4 files changed +58
-55
lines changed Expand file tree Collapse file tree 4 files changed +58
-55
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ TimeoutStartSec=86400
18
18
Restart=always
19
19
RestartSec=5
20
20
OOMScoreAdjust=-1000
21
+ EnvironmentFile=-/etc/environment.d/postgresql.env
21
22
22
23
[Install]
23
24
WantedBy=multi-user.target
Original file line number Diff line number Diff line change 39
39
40
40
# TODO include ls $(nix profile list | grep glibc-locales | tail -n 1 | cut -d ':' -f 2 | sed 's/^[ \t]*//')/lib/locale-archive
41
41
42
+ - name : Set permissions for postgresql.env
43
+ become : yes
44
+ file :
45
+ path : /etc/environment.d/postgresql.env
46
+ owner : postgres
47
+ group : postgres
48
+ mode : ' 0644'
49
+
50
+ - name : Set ownership of /etc/ssl/private directory
51
+ become : yes
52
+ file :
53
+ path : /etc/ssl/private
54
+ owner : root
55
+ group : ssl-cert
56
+ state : directory
57
+
58
+ - name : Set permissions for /etc/ssl/private directory
59
+ become : yes
60
+ file :
61
+ path : /etc/ssl/private
62
+ mode : ' 0750'
63
+ state : directory
64
+
65
+
66
+ - name : Set ownership of private key file
67
+ become : yes
68
+ file :
69
+ path : /etc/ssl/private/server.key
70
+ owner : root
71
+ group : ssl-cert
72
+ state : file
73
+
74
+ - name : Set permissions for private key file
75
+ become : yes
76
+ file :
77
+ path : /etc/ssl/private/server.key
78
+ mode : ' 0640'
79
+ state : file
80
+
42
81
- name : Ensure /usr/lib/postgresql/bin directory exists
43
82
file :
44
83
path : /usr/lib/postgresql/bin
182
221
LC_ALL : en_US.UTF-8
183
222
LC_CTYPE : en_US.UTF-8
184
223
LOCALE_ARCHIVE : /usr/lib/locale/locale-archive
185
- # LOCALE_ARCHIVE: /usr/lib/locale/locale-archive
186
- # LOCALE_ARCHIVE: /usr/lib/locale/locale-archive
187
224
vars :
188
225
ansible_command_timeout : 60
189
- # # Circumvents the following error:
190
- # # "Timeout (12s) waiting for privilege escalation prompt"
226
+ # Circumvents the following error:
227
+ # "Timeout (12s) waiting for privilege escalation prompt"
191
228
192
229
- name : copy PG systemd unit
193
230
template :
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -86,7 +86,21 @@ cat << EOF > /etc/default/locale
86
86
LANG="C.UTF-8"
87
87
LC_CTYPE="C.UTF-8"
88
88
EOF
89
- localedef -i en_US -f UTF-8 en_US.UTF-8
89
+ locale-gen en_US.UTF-8
90
+ }
91
+
92
+ function setup_postgesql_env {
93
+ # Create the directory if it doesn't exist
94
+ sudo mkdir -p /etc/environment.d
95
+
96
+ # Define the contents of the PostgreSQL environment file
97
+ cat << EOF | sudo tee /etc/environment.d/postgresql.env >/dev/null
98
+ LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
99
+ LANG="en_US.UTF-8"
100
+ LANGUAGE="en_US.UTF-8"
101
+ LC_ALL="en_US.UTF-8"
102
+ LC_CTYPE="en_US.UTF-8"
103
+ EOF
90
104
}
91
105
92
106
function install_packages_for_build {
@@ -191,6 +205,7 @@ function cleanup_cache {
191
205
192
206
update_install_packages
193
207
setup_locale
208
+ setup_postgesql_env
194
209
# install_packages_for_build
195
210
install_configure_grub
196
211
setup_apparmor
You can’t perform that action at this time.
0 commit comments