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

42 lines
1.5 KiB
YAML
Raw Normal View History

2021-03-23 15:35:03 +01:00
---
- name: timescale_db_deb | Manage the installation on deb based distributions
tags: [postgresql, timescale, timescaledb]
2021-03-23 15:35:03 +01:00
block:
- name: timescale_db_deb | Repo key
ansible.builtin.get_url:
url: "{{ timescale_db_repo_key_url }}"
dest: "{{ timescale_db_repo_key }}"
owner: root
group: root
mode: "0644"
force: true
- name: timescale_db_deb | Install the repository for Ubuntu
ansible.builtin.deb822_repository:
name: timescaledb
types: [deb]
uris: "{{ timescale_db_ubuntu_repo_url }}"
components:
- [main]
suites: ["{{ ansible_distribution_release | lower }}"]
signed_by: "{{ timescale_db_repo_key }}"
2021-03-23 15:35:03 +01:00
state: present
enabled: true
2021-03-23 15:35:03 +01:00
when: ansible_distribution == "Ubuntu"
- name: timescale_db_deb | Install the timescale DB package on deb
ansible.builtin.apt:
2021-03-23 15:35:03 +01:00
pkg: '{{ timescale_db_deb_pkgs }}'
state: present
cache_valid_time: 1800
- name: timescale_db_deb | Manage the timescale + postgresql settings
tags: ['postgresql', 'postgres', 'pg_conf', 'timescale', 'timescaledb', 'timescale_conf']
2021-03-23 15:35:03 +01:00
block:
- name: timescale_db_deb | PostgreSQL settings for TimeScaleDB
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