configure.yml 962 B

123456789101112131415161718192021222324252627282930
  1. ---
  2. - name: Configure global settings.
  3. lineinfile:
  4. dest: "{{ postgresql_config_path }}/postgresql.conf"
  5. regexp: "^#?{{ item.option }}.+$"
  6. line: "{{ item.option }} = '{{ item.value }}'"
  7. state: "{{ item.state | default('present') }}"
  8. mode: 0644
  9. with_items: "{{ postgresql_global_config_options }}"
  10. notify: restart postgresql
  11. - name: Configure host based authentication (if entries are configured).
  12. template:
  13. src: "pg_hba.conf.j2"
  14. dest: "{{ postgresql_config_path }}/pg_hba.conf"
  15. owner: "{{ postgresql_user }}"
  16. group: "{{ postgresql_group }}"
  17. mode: 0600
  18. notify: restart postgresql
  19. when: postgresql_hba_entries | length > 0
  20. - name: Ensure PostgreSQL unix socket dirs exist.
  21. file:
  22. path: "{{ item }}"
  23. state: directory
  24. owner: "{{ postgresql_user }}"
  25. group: "{{ postgresql_group }}"
  26. mode: "{{ postgresql_unix_socket_directories_mode }}"
  27. with_items: "{{ postgresql_unix_socket_directories }}"