diff --git a/postgresql/tasks/main.yml b/postgresql/tasks/main.yml index 74935415..91a94b02 100644 --- a/postgresql/tasks/main.yml +++ b/postgresql/tasks/main.yml @@ -28,7 +28,6 @@ - include: postgresql-backup.yml when: - psql_postgresql_install - - psql_db_data is defined - include: pgpool-ii.yml when: psql_pgpool_service_install - include: postgresql-letsencrypt-acmetool.yml diff --git a/postgresql/tasks/postgresql-config.yml b/postgresql/tasks/postgresql-config.yml index b415d31c..30083471 100644 --- a/postgresql/tasks/postgresql-config.yml +++ b/postgresql/tasks/postgresql-config.yml @@ -5,12 +5,16 @@ tags: [ 'postgresql', 'postgres', 'pg_conf' ] - name: Set the postgresql data dir if it is different from the default + become: True + become_user: postgres action: configfile path={{ psql_conf_dir }}/postgresql.conf key=data_directory value="'{{ psql_data_dir }}'" notify: Restart postgresql when: psql_use_alternate_data_dir tags: [ 'postgresql', 'postgres', 'pg_conf' ] - name: Set some postgresql configuration parameters + become: True + become_user: postgres action: configfile path={{ psql_conf_dir }}/postgresql.conf key={{ item.name }} value="{{ item.value }}" with_items: '{{ psql_conf_parameters }}' when: item.set == 'True' diff --git a/postgresql/tasks/postgresql-ssl-config.yml b/postgresql/tasks/postgresql-ssl-config.yml index ba889883..4c0fba9e 100644 --- a/postgresql/tasks/postgresql-ssl-config.yml +++ b/postgresql/tasks/postgresql-ssl-config.yml @@ -1,6 +1,8 @@ --- - block: - name: Setup ssl in the postgresql configuration + become: True + become_user: postgres action: configfile path=/etc/postgresql/{{ psql_version }}/main/postgresql.conf key={{ item.name }} value="'{{ item.value }}'" with_items: '{{ psql_conf_ssl_parameters }}' notify: Restart postgresql