Skip to content

Commit

Permalink
Merge pull request ANXS#34 from ahelal/feature/idempotent
Browse files Browse the repository at this point in the history
Added idempotent pgdata cluster rest
  • Loading branch information
pjan committed Dec 28, 2014
2 parents 8a24c3c + 6901eec commit 840e93e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
group: "{{postgresql_admin_user}}"
state: directory
mode: 0700
register: pgdata_dir_exist

- name: PostgreSQL | Reset the cluster - drop the existing one
shell: pg_dropcluster --stop {{postgresql_version}} {{postgresql_cluster_name}}
sudo: yes
sudo_user: postgres
when: postgresql_cluster_reset
when: postgresql_cluster_reset and pgdata_dir_exist.changed

- name: PostgreSQL | Reset the cluster - create a new one (with specified encoding and locale)
shell: pg_createcluster --start --locale {{postgresql_locale}} -e {{postgresql_encoding}} -d {{postgresql_data_directory}} {{postgresql_version}} {{postgresql_cluster_name}}
sudo: yes
sudo_user: postgres
when: postgresql_cluster_reset
when: postgresql_cluster_reset and pgdata_dir_exist.changed

- name: PostgreSQL | Update configuration - pt. 1 (pg_hba.conf)
template:
Expand Down

0 comments on commit 840e93e

Please sign in to comment.