Skip to content

Commit f519287

Browse files
committed
fix: resolve deps and congif for pljava
1 parent 26f193a commit f519287

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

ansible-nix/tasks/stage2/setup-extensions.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
- name: pljava - libjvm.so location in postgresql.conf
2+
become: yes
3+
lineinfile:
4+
path: /etc/postgresql/postgresql.conf
5+
state: present
6+
line: pljava.libjvm_location = '/home/postgres/.nix-profile/lib/openjdk/lib/server/libjvm.so'
7+
18
- name: pg_cron - set cron.database_name
29
become: yes
310
lineinfile:

ansible-nix/tasks/stage2/stage2-setup-postgres.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
- name: Install openjdk11 for pljava from nix binary cache
2+
become: yes
3+
shell: |
4+
sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11"
5+
16
- name: Install Postgres from nix binary cache
27
become: yes
38
shell: |
@@ -84,7 +89,23 @@
8489
with_fileglob:
8590
- "/home/postgres/.nix-profile/bin/*"
8691
become: yes
92+
sudo ln -s /home/postgres/.nix-profile/share/pljava /usr/lib/postgresql/share/postgresql/pljava
93+
- name: Create symbolic links from /home/postgres/.nix-profile/bin to /usr/bin
94+
file:
95+
src: "/home/postgres/.nix-profile/bin/psql"
96+
dest: "/usr/bin/psql"
97+
state: link
98+
become: yes
8799

100+
- name: Create symbolic links from /home/postgres/.nix-profile/share/pljava to /usr/lib/postgresql/share/postgresql/pljava
101+
file:
102+
src: "{{ item }}"
103+
dest: "/usr/lib/postgresql/share/postgresql/pljava/{{ item | basename }}"
104+
state: link
105+
with_fileglob:
106+
- "/home/postgres/.nix-profile/share/pljava/*"
107+
become: yes
108+
88109
- name: Create symbolic links from /home/postgres/.nix-profile/bin to /usr/bin
89110
file:
90111
src: "/home/postgres/.nix-profile/bin/psql"

common-nix.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.6.1.60-nix-staged"
1+
postgres-version = "15.6.1.61-nix-staged"

0 commit comments

Comments
 (0)