You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

postgresql.yaml 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. - name: debian packages required for database management
  3. apt:
  4. pkg: python-psycopg2
  5. delegate_to: "{{ (nextcloud_database_host != 'localhost') | ternary(nextcloud_database_host,inventory_hostname) }}"
  6. - name: postgresql user
  7. postgresql_user:
  8. name: "{{ nextcloud_database_user }}"
  9. password: "{{ nextcloud_database_pass }}"
  10. delegate_to: "{{ (nextcloud_database_host != 'localhost') | ternary(nextcloud_database_host,inventory_hostname) }}"
  11. become: yes
  12. become_user: postgres
  13. - name: postgresql database
  14. postgresql_db:
  15. name: "{{nextcloud_database_name}}"
  16. encoding: UTF-8
  17. lc_collate: "{{nextcloud_postgresql_lc}}"
  18. lc_ctype: "{{nextcloud_postgresql_lc}}"
  19. template: template0
  20. owner: "{{nextcloud_database_user}}"
  21. delegate_to: "{{ (nextcloud_database_host != 'localhost') | ternary(nextcloud_database_host,inventory_hostname) }}"
  22. become: yes
  23. become_user: postgres
  24. - name: postgresql access
  25. postgresql_privs:
  26. db: "{{nextcloud_database_name}}"
  27. privs: ALL
  28. type: database
  29. role: "{{ nextcloud_database_user }}"
  30. delegate_to: "{{ (nextcloud_database_host != 'localhost') | ternary(nextcloud_database_host,inventory_hostname) }}"
  31. become: yes
  32. become_user: postgres