main.yml 608 B

1234567891011121314151617181920212223242526272829303132
  1. ---
  2. - name: Install PostgreSQL
  3. become: true
  4. apt:
  5. name: postgresql
  6. state: present
  7. - name: Install PostgreSQL tools
  8. become: true
  9. apt:
  10. name: postgresql-contrib
  11. state: present
  12. - name: Create user
  13. become: true
  14. become_user: postgres
  15. ignore_errors: yes
  16. shell: "createuser -d joystream"
  17. - name: Setup user
  18. become: true
  19. lineinfile:
  20. state: present
  21. path: "/etc/postgresql/12/main/pg_hba.conf"
  22. line: "host all joystream 127.0.0.1/8 trust"
  23. - name: Reload postgres
  24. systemd:
  25. name: postgresql
  26. state: reloaded
  27. enabled: true