style: make ansible-lint happy

This commit is contained in:
VC
2024-07-05 11:53:44 +02:00
parent 99cb02e92d
commit 4bbb789c77
13 changed files with 77 additions and 52 deletions

View File

@@ -2,5 +2,5 @@
- name: Restart postgres
ansible.builtin.service:
name: "postgresql@{{ pg_version }}-main"
name: "postgresql@{{ postgres_pg_version }}-main"
state: restarted

View File

@@ -15,7 +15,7 @@
- name: Populate postgresql directory
ansible.builtin.command:
cmd: "/usr/lib/postgresql/{{ pg_version }}/bin/initdb -E UTF-8 /srv/postgresql/"
cmd: "/usr/lib/postgresql/{{ postgres_pg_version }}/bin/initdb -E UTF-8 /srv/postgresql/"
creates: /srv/postgresql/PG_VERSION
become: true
become_user: postgres
@@ -24,14 +24,14 @@
- name: Put hba configuration files
ansible.builtin.copy:
src: "files/pg_hba.conf"
dest: "/etc/postgresql/{{ pg_version }}/main/pg_hba.conf"
dest: "/etc/postgresql/{{ postgres_pg_version }}/main/pg_hba.conf"
mode: "0640"
notify: Restart postgres
- name: Put main configuration files
ansible.builtin.template:
src: "postgresql.conf.j2"
dest: "/etc/postgresql/{{ pg_version }}/main/postgresql.conf"
dest: "/etc/postgresql/{{ postgres_pg_version }}/main/postgresql.conf"
mode: "0644"
- name: Create backup dir

View File

@@ -40,13 +40,13 @@
data_directory = '/srv/postgresql' # use data in another directory
# (change requires restart)
hba_file = '/etc/postgresql/{{ pg_version }}/main/pg_hba.conf' # host-based authentication file
hba_file = '/etc/postgresql/{{ postgres_pg_version }}/main/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '/etc/postgresql/{{ pg_version }}/main/pg_ident.conf' # ident configuration file
ident_file = '/etc/postgresql/{{ postgres_pg_version }}/main/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/{{ pg_version }}-main.pid' # write an extra PID file
external_pid_file = '/var/run/postgresql/{{ postgres_pg_version }}-main.pid' # write an extra PID file
# (change requires restart)
@@ -484,7 +484,7 @@ log_timezone = 'Europe/Paris'
# PROCESS TITLE
#------------------------------------------------------------------------------
cluster_name = '{{ pg_version }}/main' # added to process titles if nonempty
cluster_name = '{{ postgres_pg_version }}/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -500,7 +500,7 @@ cluster_name = '{{ pg_version }}/main' # added to process titles if nonempty
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
#stats_temp_directory = '/var/run/postgresql/{{ pg_version }}-main.pg_stat_tmp'
#stats_temp_directory = '/var/run/postgresql/{{ postgres_pg_version }}-main.pg_stat_tmp'
# - Monitoring -

View File

@@ -1,10 +1,10 @@
---
pg_versions:
postgres_pg_versions:
Debian:
"9": 9.6
"10": 11
"11": 13
"12": 15
pg_version: "{{ pg_versions[ansible_os_family][ansible_distribution_major_version] }}"
postgres_pg_version: "{{ postgres_pg_versions[ansible_os_family][ansible_distribution_major_version] }}"