ansible-role-timescale-db/tasks/timescale_db_el.yml

57 lines
2.3 KiB
YAML
Raw Normal View History

2021-03-23 15:35:03 +01:00
---
- name: timescale_db_el | Manage the installation on EL based distributions
tags: [postgresql, timescale, timescaledb]
2021-03-23 15:35:03 +01:00
block:
- name: timescale_db_el | Install the repository configuration on EL
ansible.builtin.template:
2021-03-23 15:35:03 +01:00
src: timescale_timescaledb.repo.j2
dest: /etc/yum.repos.d/timescale_timescaledb.repo
owner: root
group: root
mode: "0644"
- name: timescale_db_el | Install the timescale DB package on EL
ansible.builtin.yum:
2021-03-23 15:35:03 +01:00
pkg: '{{ timescale_db_el_pkgs }}'
state: present
- name: timescale_db_el | Manage the timescale + postgresql settings on EL based distributions
tags: ['postgresql', 'postgres', 'pg_conf', 'timescale', 'timescaledb', 'timescale_conf']
2021-03-23 15:35:03 +01:00
block:
2023-11-21 15:39:59 +01:00
- name: timescale_db_el | Load the timescaleDB shared library
become: true
become_user: postgres
ansible.builtin.lineinfile:
path: "{{ psql_el_conf_dir }}/postgresql.conf"
regexp: "^#shared_preload_libraries\ ="
line: "shared_preload_libraries = 'timescaledb'"
create: false
state: present
notify: Restart postgresql
- name: timescale_db_el | TimeScaleDB configuration flush handlers
ansible.builtin.meta: flush_handlers
- name: timescale_db_el | TimeScaleDB setting for postgresql on EL
become: true
2021-03-23 15:35:03 +01:00
become_user: postgres
community.postgresql.postgresql_set:
name: '{{ item.name }}'
value: "{% if item.set %}{{ item.value }}{% else %}default{% endif %}"
loop: '{{ timescaledb_configuration_settings }}'
2021-03-23 15:35:03 +01:00
notify: Reload postgresql
- name: timescale_db_el | Ensure that the conf.d directory exists
ansible.builtin.file:
dest: "{{ psql_el_conf_dir }}/conf.d"
state: directory
owner: postgres
group: postgres
mode: "0750"
- name: timescale_db_el | Some settings must be written into a config file
become: true
become_user: postgres
ansible.builtin.template:
src: timescaledb.conf.j2
dest: "{{ psql_el_conf_dir }}/conf.d/timescaledb.conf"
mode: "0644"
notify: Restart postgresql
2023-11-21 16:59:41 +01:00
- name: timescale_db_el | TimeScaleDB configuration flush handlers again after the final configuration
ansible.builtin.meta: flush_handlers