datanommer: create the database and users
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
parent
4cf50fdad2
commit
4b4f1b99d8
1 changed files with 41 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
||||||
repo_gpgcheck=0
|
repo_gpgcheck=0
|
||||||
enabled = 1
|
enabled = 1
|
||||||
tags:
|
tags:
|
||||||
|
- datanommer
|
||||||
- postgresql
|
- postgresql
|
||||||
- timescaledb
|
- timescaledb
|
||||||
when: ansible_distribution_major_version|int >= 8 and ansible_distribution == 'RedHat'
|
when: ansible_distribution_major_version|int >= 8 and ansible_distribution == 'RedHat'
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
profiles=
|
profiles=
|
||||||
state=enabled
|
state=enabled
|
||||||
tags:
|
tags:
|
||||||
|
- datanommer
|
||||||
- postgresql
|
- postgresql
|
||||||
- timescaledb
|
- timescaledb
|
||||||
when: ansible_distribution_major_version|int >= 8 and ansible_distribution == 'RedHat'
|
when: ansible_distribution_major_version|int >= 8 and ansible_distribution == 'RedHat'
|
||||||
|
@ -36,6 +38,7 @@
|
||||||
- timescaledb
|
- timescaledb
|
||||||
state: present
|
state: present
|
||||||
tags:
|
tags:
|
||||||
|
- datanommer
|
||||||
- postgresql
|
- postgresql
|
||||||
- timescaledb
|
- timescaledb
|
||||||
|
|
||||||
|
@ -47,5 +50,43 @@
|
||||||
notify:
|
notify:
|
||||||
- restart postgresql
|
- restart postgresql
|
||||||
tags:
|
tags:
|
||||||
|
- datanommer
|
||||||
- postgresql
|
- postgresql
|
||||||
- timescaledb
|
- timescaledb
|
||||||
|
|
||||||
|
|
||||||
|
# Database users
|
||||||
|
#
|
||||||
|
- name: create the main DB user
|
||||||
|
become_user: postgres
|
||||||
|
become: true
|
||||||
|
postgresql_user:
|
||||||
|
name: "{{ datanommerDBUser }}"
|
||||||
|
password: "{{ (env == 'production')|ternary(datanommerDBPassword, datanommer_stg_db_password) }}"
|
||||||
|
tags:
|
||||||
|
- datanommer
|
||||||
|
- postgresql
|
||||||
|
|
||||||
|
- name: create the RO DB user
|
||||||
|
become_user: postgres
|
||||||
|
become: true
|
||||||
|
postgresql_user:
|
||||||
|
name: datanommer_ro
|
||||||
|
password: "{{ datanommer_ro_password }}"
|
||||||
|
tags:
|
||||||
|
- datanommer
|
||||||
|
- postgresql
|
||||||
|
|
||||||
|
|
||||||
|
# Databases
|
||||||
|
#
|
||||||
|
- name: create the datanommer database
|
||||||
|
become_user: postgres
|
||||||
|
become: true
|
||||||
|
postgresql_db:
|
||||||
|
name: datanommer2
|
||||||
|
owner: "{{ datanommerDBUser }}"
|
||||||
|
encoding: UTF-8
|
||||||
|
tags:
|
||||||
|
- datanommer
|
||||||
|
- postgresql
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue