This will unify all the handlers to use first uppercase letter for ansible-lint to stop complaining. I went through all `notify:` occurrences and fixed them by running ``` set TEXT "text_to_replace"; set REPLACEMENT "replacement_text"; git grep -rlz "$TEXT" . | xargs -0 sed -i "s/$TEXT/$REPLACEMENT/g" ``` Then I went through all the changes and removed the ones that wasn't expected to be changed. Fixes https://pagure.io/fedora-infrastructure/issue/12391 Signed-off-by: Michal Konecny <mkonecny@redhat.com>
62 lines
1.3 KiB
YAML
62 lines
1.3 KiB
YAML
---
|
|
- name: Install timescaledb
|
|
dnf:
|
|
name:
|
|
- timescaledb
|
|
state: present
|
|
tags:
|
|
- datanommer
|
|
- postgresql
|
|
- timescaledb
|
|
|
|
- name: Add timescaledb to postgresql config
|
|
lineinfile:
|
|
path: /var/lib/pgsql/data/postgresql.conf
|
|
regexp: ^shared_preload_libraries =
|
|
line: "shared_preload_libraries = 'timescaledb'"
|
|
notify:
|
|
- Restart postgresql
|
|
tags:
|
|
- datanommer
|
|
- postgresql
|
|
- timescaledb
|
|
|
|
|
|
- block:
|
|
|
|
# Users
|
|
- name: Create the main DB user
|
|
postgresql_user:
|
|
name: "{{ datanommerDBUser }}"
|
|
password: "{{ (env == 'production')|ternary(datanommerDBPassword, datanommer_stg_db_password) }}"
|
|
|
|
- name: Create the RO DB user
|
|
postgresql_user:
|
|
name: datanommer_ro
|
|
password: "{{ datanommer_ro_password }}"
|
|
|
|
# Databases
|
|
- name: Create the datanommer database
|
|
postgresql_db:
|
|
name: datanommer2
|
|
owner: "{{ datanommerDBUser }}"
|
|
encoding: UTF-8
|
|
|
|
- name: Grant datanommer_ro read only access to datanommer2
|
|
postgresql_privs:
|
|
database: datanommer2
|
|
privs: SELECT
|
|
objs: ALL_IN_SCHEMA
|
|
roles: datanommer_ro
|
|
|
|
# Enable timescaledb
|
|
- name: Enable timescaledb
|
|
postgresql_ext:
|
|
name: timescaledb
|
|
db: datanommer2
|
|
|
|
become: true
|
|
become_user: postgres
|
|
tags:
|
|
- datanommer
|
|
- postgresql
|