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

36 lines
1.2 KiB
YAML

---
- name: Manage the installation on deb based distributions
block:
- name: Install the Ubuntu PPA
apt_repository:
repo: '{{ timescale_db_ubuntu_repo }}'
update_cache: True
state: present
when: ansible_distribution == "Ubuntu"
- name: Install the timescale DB package on deb
apt:
pkg: '{{ timescale_db_deb_pkgs }}'
state: present
cache_valid_time: 1800
tags: [ postgresql, timescale, timescaledb ]
- name: Manage the timescale + postgresql settings
block:
- name: Enable the TimeScaleDB extension
become: True
become_user: postgres
action: configfile path={{ psql_conf_dir }}/postgresql.conf key=shared_preload_libraries value="'timescaledb'"
notify: Restart postgresql
- name: TimeScaleDB setting for postgresql
become: True
become_user: postgres
action: configfile path={{ psql_conf_dir }}/postgresql.conf key={{ item.name }} value="{{ item.value }}"
with_items: '{{ timescaledb_configuration_settings }}'
when: item.set == 'True'
notify: Reload postgresql
tags: [ 'postgresql', 'postgres', 'pg_conf', 'timescale', 'timescaledb', 'timescale_conf' ]