]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blobdiff - tasks/postgres-user.yml
Allow to use any ansible become method
[github/fretlink/ansible-postgresql-role.git] / tasks / postgres-user.yml
index 308dab839ef65aa1e0b5749e202138247ca0db68..fcef9fc42717017efd8d2ff7341964c68a10b3fd 100644 (file)
@@ -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 }}"