added vectordb
This commit is contained in:
parent
314b52f033
commit
3ab7b1731a
@ -16,6 +16,8 @@ all:
|
|||||||
ansible_host: 192.168.180.190
|
ansible_host: 192.168.180.190
|
||||||
timescaledb:
|
timescaledb:
|
||||||
ansible_host: 192.168.150.130
|
ansible_host: 192.168.150.130
|
||||||
|
vectordb:
|
||||||
|
ansible_host: 192.168.150.131
|
||||||
harvester:
|
harvester:
|
||||||
ansible_host: 192.168.150.175
|
ansible_host: 192.168.150.175
|
||||||
n8n:
|
n8n:
|
||||||
|
|||||||
78
playbooks/captica-automation-vector-database.yml
Normal file
78
playbooks/captica-automation-vector-database.yml
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
- hosts: "leh01"
|
||||||
|
name: Create container
|
||||||
|
vars:
|
||||||
|
lxc_id: 130
|
||||||
|
lxc_name: vectordb
|
||||||
|
lxc_domain: leh01.local
|
||||||
|
lxc_template: "local:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst"
|
||||||
|
lxc_mac: CC:CC:CC:15:01:31
|
||||||
|
lxc_ip: 192.168.150.131
|
||||||
|
lxc_bridge: vmbr150
|
||||||
|
lxc_vlan: ""
|
||||||
|
lxc_disk: datapool:32
|
||||||
|
lxc_cpu: 2
|
||||||
|
lxc_memory: 2048
|
||||||
|
lxc_swap: 1024
|
||||||
|
lxc_ssh_pub_key: ~/.ssh/id_ed25519_ansible.pub
|
||||||
|
roles:
|
||||||
|
- lxc-container
|
||||||
|
|
||||||
|
- hosts: "vectordb"
|
||||||
|
vars:
|
||||||
|
hostname: vectordb
|
||||||
|
lxc_ip: 192.168.150.131
|
||||||
|
tools_install_users:
|
||||||
|
- root
|
||||||
|
- ansible
|
||||||
|
ssh_pubkeys_root:
|
||||||
|
- "../files/ssh/root.pub"
|
||||||
|
ssh_pubkeys_ansible:
|
||||||
|
- "../files/ssh/id_ed25519_ansible.pub"
|
||||||
|
roles:
|
||||||
|
- linux-base-install
|
||||||
|
- zsh
|
||||||
|
- vim
|
||||||
|
- fzf
|
||||||
|
|
||||||
|
- hosts: "vectordb"
|
||||||
|
vars:
|
||||||
|
hostname: vectordb
|
||||||
|
lxc_ip: 192.168.150.131
|
||||||
|
tools_install_users:
|
||||||
|
- root
|
||||||
|
- ansible
|
||||||
|
tasks:
|
||||||
|
- import_tasks: "../roles/common/tasks/common.yml"
|
||||||
|
|
||||||
|
- hosts: "vectordb"
|
||||||
|
vars:
|
||||||
|
lxc_ip: 192.168.150.131
|
||||||
|
postgresql_admin_password: captica
|
||||||
|
postgresql_allowed_hosts:
|
||||||
|
- '0.0.0.0/0'
|
||||||
|
timescaledb_database_name: vectordb
|
||||||
|
timescaledb_database_schema: captica
|
||||||
|
timescaledb_database_user: captica
|
||||||
|
timescaledb_database_password: captica
|
||||||
|
tools_install_users:
|
||||||
|
- ansible
|
||||||
|
- root
|
||||||
|
roles:
|
||||||
|
- timescaledb
|
||||||
|
|
||||||
|
- hosts: "vectordb"
|
||||||
|
vars:
|
||||||
|
lxc_ip: 192.168.150.131
|
||||||
|
postgresql_version: 16
|
||||||
|
postgresql_admin_password: captica
|
||||||
|
postgresql_allowed_hosts:
|
||||||
|
- '0.0.0.0/0'
|
||||||
|
timescaledb_database_name: vectordb
|
||||||
|
timescaledb_database_schema: captica
|
||||||
|
timescaledb_database_user: captica
|
||||||
|
timescaledb_database_password: captica
|
||||||
|
tools_install_users:
|
||||||
|
- ansible
|
||||||
|
- root
|
||||||
|
tasks:
|
||||||
|
- import_tasks: "../roles/common/tasks/postgres_vector.yml"
|
||||||
38
roles/common/tasks/postgres_vector.yml
Normal file
38
roles/common/tasks/postgres_vector.yml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
- name: "Install pgvector extension postgresql-{{ postgresql_version }}-pgvector"
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- install
|
||||||
|
- timescaledb_install
|
||||||
|
apt:
|
||||||
|
pkg:
|
||||||
|
- "postgresql-{{ postgresql_version }}-pgvector"
|
||||||
|
state: latest
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: "Stop postgresql service"
|
||||||
|
tags:
|
||||||
|
- install
|
||||||
|
- timescaledb_install
|
||||||
|
systemd:
|
||||||
|
name: postgresql
|
||||||
|
state: stopped
|
||||||
|
|
||||||
|
- name: "Start postgresql service"
|
||||||
|
tags:
|
||||||
|
- install
|
||||||
|
- timescaledb_install
|
||||||
|
systemd:
|
||||||
|
name: postgresql
|
||||||
|
state: started
|
||||||
|
|
||||||
|
- name: "Create pgvector functions on database {{ timescaledb_database_name }}"
|
||||||
|
tags:
|
||||||
|
- install
|
||||||
|
- timescaledb_install
|
||||||
|
postgresql_ext:
|
||||||
|
name: pgvector
|
||||||
|
db: "{{ timescaledb_database_name }}"
|
||||||
|
state: present
|
||||||
|
login_user: "postgres"
|
||||||
|
login_password: "{{ postgresql_admin_password }}"
|
||||||
|
login_host: "{{ lxc_ip }}"
|
||||||
Loading…
Reference in New Issue
Block a user