diff --git a/roles/common/tasks/postgres_cron.yml b/roles/common/tasks/postgres_cron.yml index e0e9932..6dd21f5 100644 --- a/roles/common/tasks/postgres_cron.yml +++ b/roles/common/tasks/postgres_cron.yml @@ -8,6 +8,14 @@ state: latest update_cache: yes +- name: "Stop postgresql service" + tags: + - install + - timescaledb_install + systemd: + name: postgresql + state: stop + - name: "Add pg_cron to shared_preload_libraries" tags: - install @@ -25,7 +33,7 @@ dest: /etc/postgresql/{{ postgresql_version }}/main/postgresql.conf line: "cron.database_name = '{{ timescaledb_database_name }}'" -- name: "Define cron database name" +- name: "Define cron timezone" tags: - install - timescaledb_install @@ -47,11 +55,11 @@ - timescaledb_install postgresql_query: db: "{{ timescaledb_database_name }}" - login_user: "postgres" - login_password: "{{ postgresql_admin_password }}" + login_user: "{{ timescaledb_database_user }}" + login_password: "{{ timescaledb_database_password }}" + login_host: "{{ lxc_ip }}" query: - CREATE EXTENSION pg_cron; - - GRANT USAGE ON SCHEMA cron TO {{ timescaledb_database_user }}; - name: "Restart postgresql service" tags: