File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -672,6 +672,7 @@ postgresql_search_path: # schema names
672672postgresql_default_tablespace : " " # a tablespace name, "" uses the default
673673postgresql_temp_tablespaces : [] # a list of tablespace names
674674postgresql_default_table_access_method : " heap"
675+ postgresql_tablespaces_dirs : [] # a list of directories for tablespaces to be created
675676
676677postgresql_check_function_bodies : on
677678postgresql_default_transaction_isolation : " read committed"
Original file line number Diff line number Diff line change 1616 mode : 0700
1717 register : pgdata_dir_exist
1818
19+ - name : PostgreSQL | Make sure postgres tablespaces directories exist
20+ file :
21+ path : " {{ item }}"
22+ owner : " {{ postgresql_service_user }}"
23+ group : " {{ postgresql_service_group }}"
24+ state : directory
25+ mode : 0700
26+ with_items : " {{ postgresql_tablespaces_dirs }}"
27+
1928- name : PostgreSQL | Make sure the postgres WAL directory exists
2029 file :
2130 path : " {{ postgresql_wal_directory }}"
217226 mode : u=rwX,g=rwXs,o=rx
218227 notify : restart postgresql
219228
220- - name : PostgreSQL | Reload all conf files
221- service :
222- name : " {{ postgresql_service_name }}"
223- state : reloaded
229+ - block :
230+ - name : PostgreSQL | Check if cluster is running
231+ command : " pg_ctlcluster {{ postgresql_version }} {{ postgresql_cluster_name }} status"
232+ ignore_errors : true
233+ register : postgresql_cluster_running
234+
235+ - name : PostgreSQL | Reload cluster
236+ command : " pg_ctlcluster {{ postgresql_version }} {{ postgresql_cluster_name }} reload"
237+ when : postgresql_cluster_running.rc == 0
238+
239+ - name : PostgreSQL | Start cluster
240+ command : " pg_ctlcluster {{ postgresql_version }} {{ postgresql_cluster_name }} start"
241+ when : postgresql_cluster_running.rc != 0
224242 when : postgresql_configuration_pt1.changed or postgresql_configuration_pt2.changed or postgresql_configuration_pt3.changed or postgresql_systemd_custom_conf.changed
You can’t perform that action at this time.
0 commit comments