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.

27 lines
781 B

  1. ---
  2. - name: Add APT key for PostgreSQL repository
  3. apt_key:
  4. url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
  5. - name: Add PostgreSQL APT repository
  6. apt_repository:
  7. repo: deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main
  8. - name: Install PostgreSQL
  9. apt:
  10. name: postgresql-{{ postgresql_version }}
  11. - name: Start and enable PostgreSQL service
  12. service:
  13. name: postgresql
  14. state: started
  15. enabled: true
  16. - name: Set configuration options in postgresql.conf
  17. lineinfile:
  18. path: /etc/postgresql/{{ postgresql_version }}/main/postgresql.conf
  19. regexp: "^#?{{ item.key }} ?="
  20. line: "{{ item.key }} = {{ item.value }}"
  21. loop: "{{ _postgresql_settings | combine(postgresql_settings) | dict2items }}"
  22. notify:
  23. - Restart postgresql