aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/postgres-database.yml
diff options
context:
space:
mode:
authorThéophile Helleboid <theophile.helleboid@captaintrain.com>2019-05-02 17:34:44 +0200
committerThéophile Helleboid <theophile.helleboid@captaintrain.com>2019-05-02 17:34:44 +0200
commit29f3186f165565e03b3b091523f8b682be99404a (patch)
tree214db2306ef4a929da043d0209ca70bde78ee28b /tasks/postgres-database.yml
parent0c83dd00b4110d55b1602ca8d732a8cb414cfd0a (diff)
downloadansible-postgresql-role-29f3186f165565e03b3b091523f8b682be99404a.tar.gz
ansible-postgresql-role-29f3186f165565e03b3b091523f8b682be99404a.tar.zst
ansible-postgresql-role-29f3186f165565e03b3b091523f8b682be99404a.zip
Allow to use any ansible become method
The variable can be set to 'sudo' if ansible uses sudo
Diffstat (limited to 'tasks/postgres-database.yml')
-rw-r--r--tasks/postgres-database.yml4
1 files changed, 2 insertions, 2 deletions
diff --git a/tasks/postgres-database.yml b/tasks/postgres-database.yml
index c3537ea..0be2dff 100644
--- a/tasks/postgres-database.yml
+++ b/tasks/postgres-database.yml
@@ -1,7 +1,7 @@
1- name: Test if the PostgreSQL server is up 1- name: Test if the PostgreSQL server is up
2 become: true 2 become: true
3 become_user: postgres 3 become_user: postgres
4 become_method: su 4 become_method: "{{ postgres_become_method }}"
5 command: psql --port={{ postgres_port }} --command='select NOW()' 5 command: psql --port={{ postgres_port }} --command='select NOW()'
6 register: postgres_up 6 register: postgres_up
7 ignore_errors: yes 7 ignore_errors: yes
@@ -11,7 +11,7 @@
11- name: Create PostgreSQL database 11- name: Create PostgreSQL database
12 become: true 12 become: true
13 become_user: postgres 13 become_user: postgres
14 become_method: su 14 become_method: "{{ postgres_become_method }}"
15 postgresql_db: 15 postgresql_db:
16 port: "{{ postgres_port }}" 16 port: "{{ postgres_port }}"
17 name: "{{ postgres_dbname }}" 17 name: "{{ postgres_dbname }}"