1
0

main.yml 972 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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: Set password
  18. become: true
  19. become_user: postgres
  20. ignore_errors: yes
  21. shell: psql -c "ALTER USER joystream WITH PASSWORD '123';"
  22. - name: Setup user
  23. become: true
  24. lineinfile:
  25. state: present
  26. path: "/etc/postgresql/12/main/pg_hba.conf"
  27. line: "host all joystream 127.0.0.1/8 trust"
  28. - name: Reload postgres
  29. systemd:
  30. name: postgresql
  31. state: reloaded
  32. enabled: true
  33. become: true
  34. #TODO
  35. #host all joystream 127.0.0.1/8 trust
  36. #sudo -u postgres psql
  37. #ALTER USER joystream WITH PASSWORD '123';
  38. #cd /home/joystream/jsstats
  39. #createdb jsstats
  40. #npm run seed