talas-group/04_INFRA_DEPLOIEMENT/Ansible/roles/postgres/tasks/configuration.yml
senke 66471934af Initial commit: Talas Group project management & documentation
Knowledge base of ~80+ markdown files across 14 domains (00-13),
Logseq graph, hardware design files (KiCAD), infrastructure configs,
and talas-wiki static site.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 20:10:41 +02:00

93 lines
2.3 KiB
YAML

---
# file: roles/postgres/tasks/configuration.yml
- name: "config file {{ pg_data_directory }}/postgresql.conf"
template:
src: "postgresql.conf.j2"
dest: "{{ pg_data_directory }}/postgresql.conf"
owner: postgres
group: postgres
backup: yes
mode: 0600
notify: reload postgres
tags: postgres
- name: "duplicate config to /etc/postgresql/{{ pg_version }}/{{ pg_cluster_name }}/postgresql.conf"
template:
src: "postgresql.conf.j2"
dest: "/etc/postgresql/{{ pg_version }}/{{ pg_cluster_name }}/postgresql.conf"
owner: postgres
group: postgres
backup: yes
mode: 0600
notify: reload postgres
when: not ansible_check_mode
tags: postgres
- name: "{{ pg_configuration_file_restart_required }}"
template:
src: "restart_required.conf"
dest: "{{ pg_configuration_file_restart_required }}"
owner: postgres
group: postgres
backup: yes
mode: 0600
notify: restart postgres
tags: postgres
- name: "{{ pg_configuration_file_restart_required_extra_location }}"
template:
src: "restart_required.conf"
dest: "{{ pg_configuration_file_restart_required_extra_location }}"
owner: postgres
group: postgres
backup: yes
mode: 0600
notify: restart postgres
when: pg_configuration_file_restart_required_extra_location is defined
tags: postgres
- name: "logging directory"
file:
path: '{{ pg_log_directory }}'
state: directory
mode: 0755
owner: postgres
group: postgres
notify: reload postgres
when: pg_logging
tags: postgres
- name: "postgres user .bash_profile"
template:
src: postgres_bash_profile
dest: /var/lib/postgresql/.bash_profile
owner: postgres
group: postgres
tags: postgres
- name: "{{ pg_data_directory }}/pg_hba.conf"
template:
backup: yes
src: pg_hba.conf
dest: "{{ pg_data_directory }}/pg_hba.conf"
owner: postgres
group: postgres
mode: 0600
notify: reload postgres
tags:
- postgres
- pg_hba
- name: "duplicate config to /etc/postgresql/{{ pg_version }}/{{ pg_cluster_name }}/pg_hba.conf"
template:
backup: yes
src: pg_hba.conf
dest: "/etc/postgresql/{{ pg_version }}/{{ pg_cluster_name }}/pg_hba.conf"
owner: postgres
group: postgres
mode: 0600
notify: reload postgres
tags:
- postgres
- pg_hba