From 29f3186f165565e03b3b091523f8b682be99404a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Helleboid?= Date: Thu, 2 May 2019 17:34:44 +0200 Subject: Allow to use any ansible become method The variable can be set to 'sudo' if ansible uses sudo --- tasks/postgres-user.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tasks/postgres-user.yml') diff --git a/tasks/postgres-user.yml b/tasks/postgres-user.yml index 308dab8..fcef9fc 100644 --- a/tasks/postgres-user.yml +++ b/tasks/postgres-user.yml @@ -1,7 +1,7 @@ - name: Test if the PostgreSQL server is up become: true become_user: postgres - become_method: su + become_method: "{{ postgres_become_method }}" command: psql --port={{ postgres_port }} --command='select NOW()' register: postgres_up ignore_errors: yes @@ -11,7 +11,7 @@ - name: Create PostgreSQL user become: true become_user: postgres - become_method: su + become_method: "{{ postgres_become_method }}" postgresql_user: port: "{{ postgres_port }}" name: "{{ postgres_username }}" -- cgit v1.2.3