feat: pg with extensions and open to podmans containers

This commit is contained in:
Clément Désiles
2025-11-11 00:02:15 +01:00
parent ba37edd498
commit e7dbe470da
7 changed files with 158 additions and 98 deletions
+38
View File
@@ -0,0 +1,38 @@
---
- name: Check if pgvector is installed
ansible.builtin.command: pacman -Qi pgvector
register: pgvector_installed
changed_when: false
failed_when: false
- name: Install pgvector from AUR
when: pgvector_installed.rc != 0
block:
- name: Disable SUDOERS password prompt for AUR installation
no_log: true
ansible.builtin.lineinfile:
dest: /etc/sudoers
state: present
regexp: "^#?%wheel"
line: "%wheel ALL=(ALL) NOPASSWD: ALL"
validate: /usr/sbin/visudo -cf %s
- name: Install pgvector from AUR
become: false
ansible.builtin.command:
cmd: "paru -S --noconfirm pgvector"
- name: Restore SUDOERS password prompt after AUR installation
no_log: true
ansible.builtin.lineinfile:
dest: /etc/sudoers
state: present
regexp: "^#?%wheel"
line: "%wheel ALL=(ALL:ALL) ALL"
validate: /usr/sbin/visudo -cf %s
- name: Ensure PostgreSQL is initialized
ansible.builtin.command:
cmd: initdb -D {{ postgres_data_dir }}
creates: "{{ postgres_data_dir }}/PG_VERSION"
become_user: "{{ postgres_admin_user }}"