|
89 | 89 | group: postgres
|
90 | 90 | mode: 0700
|
91 | 91 |
|
92 |
| -- name: Create symbolic links from /home/postgres/.nix-profile/bin to /usr/lib/postgresql/bin |
| 92 | +- name: Create symbolic links from /var/lib/postgresql/.nix-profile/bin to /usr/lib/postgresql/bin |
93 | 93 | file:
|
94 | 94 | src: "{{ item }}"
|
95 | 95 | dest: "/usr/lib/postgresql/bin/{{ item | basename }}"
|
96 | 96 | state: link
|
97 | 97 | with_fileglob:
|
98 |
| - - "/home/postgres/.nix-profile/bin/*" |
| 98 | + - "/var/lib/postgresql/.nix-profile/bin/*" |
99 | 99 | become: yes
|
100 | 100 |
|
101 |
| -- name: Create symbolic links from /home/postgres/.nix-profile/bin to /usr/bin |
| 101 | +- name: Create symbolic links from /var/lib/postgresql/.nix-profile/bin to /usr/bin |
102 | 102 | file:
|
103 |
| - src: "/home/postgres/.nix-profile/bin/psql" |
| 103 | + src: "/var/lib/postgresql/.nix-profile/bin/psql" |
104 | 104 | dest: "/usr/bin/psql"
|
105 | 105 | state: link
|
106 | 106 | become: yes
|
107 | 107 |
|
108 |
| -# - name: Create symbolic links from /home/postgres/.nix-profile/share/pljava to /usr/lib/postgresql/share/postgresql/pljava |
| 108 | +# - name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/pljava to /usr/lib/postgresql/share/postgresql/pljava |
109 | 109 | # file:
|
110 | 110 | # src: "{{ item }}"
|
111 | 111 | # dest: "/usr/lib/postgresql/share/postgresql/pljava/{{ item | basename }}"
|
112 | 112 | # state: link
|
113 | 113 | # with_fileglob:
|
114 |
| -# - "/home/postgres/.nix-profile/share/pljava/*" |
| 114 | +# - "/var/lib/postgresql/.nix-profile/share/pljava/*" |
115 | 115 | # become: yes
|
116 | 116 | # It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task
|
117 | 117 |
|
118 |
| -- name: Create symbolic links from /home/postgres/.nix-profile/bin to /usr/bin |
| 118 | +- name: Create symbolic links from /var/lib/postgresql/.nix-profile/bin to /usr/bin |
119 | 119 | file:
|
120 |
| - src: "/home/postgres/.nix-profile/bin/psql" |
| 120 | + src: "/var/lib/postgresql/.nix-profile/bin/psql" |
121 | 121 | dest: "/usr/bin/psql"
|
122 | 122 | state: link
|
123 | 123 | become: yes
|
124 | 124 |
|
125 |
| -- name: Create symbolic links from /home/postgres/.nix-profile/share/postgresql to /usr/lib/postgresql/share/postgresql |
| 125 | +- name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql to /usr/lib/postgresql/share/postgresql |
126 | 126 | file:
|
127 | 127 | src: "{{ item }}"
|
128 | 128 | dest: "/usr/lib/postgresql/share/postgresql/{{ item | basename }}"
|
129 | 129 | state: link
|
130 | 130 | with_fileglob:
|
131 |
| - - "/home/postgres/.nix-profile/share/postgresql/*" |
| 131 | + - "/var/lib/postgresql/.nix-profile/share/postgresql/*" |
132 | 132 | become: yes
|
133 | 133 |
|
134 |
| -- name: Create symbolic links from /home/postgres/.nix-profile/share/postgresql/extension to /usr/lib/postgresql/share/postgresql/extension |
| 134 | +- name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/extension to /usr/lib/postgresql/share/postgresql/extension |
135 | 135 | file:
|
136 | 136 | src: "{{ item }}"
|
137 | 137 | dest: "/usr/lib/postgresql/share/postgresql/extension/{{ item | basename }}"
|
138 | 138 | state: link
|
139 | 139 | with_fileglob:
|
140 |
| - - "/home/postgres/.nix-profile/share/postgresql/extension/*" |
| 140 | + - "/var/lib/postgresql/.nix-profile/share/postgresql/extension/*" |
141 | 141 | become: yes
|
142 | 142 |
|
143 | 143 | - name: create destination directory
|
|
149 | 149 | - name: Recursively create symbolic links and set permissions for the contrib/postgis-* dir
|
150 | 150 | shell: >
|
151 | 151 | sudo mkdir -p /usr/lib/postgresql/share/postgresql/contrib && \
|
152 |
| - sudo find /home/postgres/.nix-profile/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do sudo ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ |
| 152 | + sudo find /var/lib/postgresql/.nix-profile/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do sudo ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ |
153 | 153 | && chown -R postgres:postgres "/usr/lib/postgresql/share/postgresql/contrib/"
|
154 | 154 | become: yes
|
155 | 155 |
|
156 |
| -- name: Create symbolic links from /home/postgres/.nix-profile/share/postgresql/timezonesets to /usr/lib/postgresql/share/postgresql/timeszonesets |
| 156 | +- name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/timezonesets to /usr/lib/postgresql/share/postgresql/timeszonesets |
157 | 157 | file:
|
158 | 158 | src: "{{ item }}"
|
159 | 159 | dest: "/usr/lib/postgresql/share/postgresql/timezonesets/{{ item | basename }}"
|
160 | 160 | state: link
|
161 | 161 | with_fileglob:
|
162 |
| - - "/home/postgres/.nix-profile/share/postgresql/timezonesets/*" |
| 162 | + - "/var/lib/postgresql/.nix-profile/share/postgresql/timezonesets/*" |
163 | 163 | become: yes
|
164 | 164 |
|
165 |
| -- name: Create symbolic links from /home/postgres/.nix-profile/share/postgresql/tsearch_data to /usr/lib/postgresql/share/postgresql/tsearch_data |
| 165 | +- name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/tsearch_data to /usr/lib/postgresql/share/postgresql/tsearch_data |
166 | 166 | file:
|
167 | 167 | src: "{{ item }}"
|
168 | 168 | dest: "/usr/lib/postgresql/share/postgresql/tsearch_data/{{ item | basename }}"
|
169 | 169 | state: link
|
170 | 170 | with_fileglob:
|
171 |
| - - "/home/postgres/.nix-profile/share/postgresql/tsearch_data/*" |
| 171 | + - "/var/lib/postgresql/.nix-profile/share/postgresql/tsearch_data/*" |
172 | 172 | become: yes
|
173 | 173 |
|
174 | 174 |
|
|
188 | 188 | - name: Initialize the database
|
189 | 189 | become: yes
|
190 | 190 | become_user: postgres
|
191 |
| - shell: source /home/postgres/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" |
| 191 | + shell: source /var/lib/postgresql/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" |
192 | 192 | args:
|
193 | 193 | executable: /bin/bash
|
194 | 194 | environment:
|
|
216 | 216 | become: yes
|
217 | 217 | become_user: postgres
|
218 | 218 | shell: |
|
219 |
| - source /home/postgres/.bashrc |
| 219 | + source /var/lib/postgresql/.bashrc |
220 | 220 | /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data start
|
221 | 221 | environment:
|
222 | 222 | LANG: en_US.UTF-8
|
|
242 | 242 | become: yes
|
243 | 243 | become_user: postgres
|
244 | 244 | shell: |
|
245 |
| - source /home/postgres/.bashrc && \ |
| 245 | + source /var/lib/postgresql/.bashrc && \ |
246 | 246 | /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data restart -o "-c shared_preload_libraries='pg_tle'"
|
247 | 247 | args:
|
248 | 248 | executable: /bin/bash
|
|
0 commit comments