feat: pg with extensions and open to podmans containers
This commit is contained in:
@@ -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 }}"
|
||||
Reference in New Issue
Block a user