mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Implement postgresql ansible role
This commit is contained in:
committed by
Dan Christian Bogos
parent
b6df49fbb6
commit
7faab6e0ff
@@ -13,6 +13,10 @@
|
||||
import_role:
|
||||
name: ../roles/install_mongodb
|
||||
|
||||
- name: Install PostgreSQL
|
||||
import_role:
|
||||
name: ../roles/postgresql
|
||||
|
||||
- name: Install Go
|
||||
import_role:
|
||||
name: ../roles/install_go
|
||||
|
||||
@@ -9,7 +9,5 @@ cgrates_dependencies:
|
||||
- git
|
||||
- redis-server
|
||||
- mariadb-server
|
||||
- postgresql
|
||||
- postgresql-contrib
|
||||
- make
|
||||
- gcc
|
||||
4
data/ansible/roles/postgresql/defaults/main.yaml
Normal file
4
data/ansible/roles/postgresql/defaults/main.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
postgresql_version: "postgresql"
|
||||
postgresql_repo: "http://apt.postgresql.org/pub/repos/apt"
|
||||
postgresql_key_url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc"
|
||||
20
data/ansible/roles/postgresql/tasks/main.yaml
Normal file
20
data/ansible/roles/postgresql/tasks/main.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Create the PostgreSQL repository configuration
|
||||
become: yes
|
||||
ansible.builtin.copy:
|
||||
content: "deb {{ postgresql_repo }} {{ ansible_distribution_release }}-pgdg main"
|
||||
dest: /etc/apt/sources.list.d/pgdg.list
|
||||
when: not (ansible.builtin.stat.exists is defined and ansible.builtin.stat.exists)
|
||||
|
||||
- name: Import the PostgreSQL repository signing key
|
||||
become: yes
|
||||
ansible.builtin.apt_key:
|
||||
url: "{{ postgresql_key_url }}"
|
||||
state: present
|
||||
|
||||
- name: Update the package lists and ensure PostgreSQL is the latest version
|
||||
become: yes
|
||||
ansible.builtin.apt:
|
||||
name: "{{ postgresql_version }}"
|
||||
state: latest
|
||||
update_cache: yes
|
||||
Reference in New Issue
Block a user