]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blobdiff - tasks/postgres-database.yml
Allow to use any ansible become method
[github/fretlink/ansible-postgresql-role.git] / tasks / postgres-database.yml
index c3537eaaeef61c7b30121b348885d1e38bad64cf..0be2dffcecbffb02c5a492692dd43128ff2eb032 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 database
   become: true
   become_user: postgres
-  become_method: su
+  become_method: "{{ postgres_become_method }}"
   postgresql_db:
     port:             "{{ postgres_port }}"
     name:             "{{ postgres_dbname }}"