style: make ansible-lint happier

This commit is contained in:
VC
2024-07-05 11:53:33 +02:00
parent 2d3fd5bd8e
commit 30ec08487f
2 changed files with 25 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
---
- name: restart postgres
service:
- name: Restart postgres
ansible.builtin.service:
name: "postgresql@{{ pg_version }}-main"
state: restarted

View File

@@ -1,46 +1,50 @@
---
- name: install postgresql
package:
- name: Install postgresql
ansible.builtin.package:
name: postgresql
state: present
- name: create pgsql directory
file:
- name: Create pgsql directory
ansible.builtin.file:
path: /srv/postgresql
owner: postgres
group: postgres
state: directory
mode: 0755
- name: populate postgresql directory
command: "/usr/lib/postgresql/{{ pg_version }}/bin/initdb -E UTF-8 /srv/postgresql/"
- name: Populate postgresql directory
ansible.builtin.command:
cmd: "/usr/lib/postgresql/{{ pg_version }}/bin/initdb -E UTF-8 /srv/postgresql/"
creates: /srv/postgresql/PG_VERSION
become: true
become_user: postgres
args:
creates: /srv/postgresql/PG_VERSION
notify: restart postgres
notify: Restart postgres
- name: replace main conffile
copy:
- name: Replace main conffile
ansible.builtin.copy:
src: files/postgresql.conf
dest: "/etc/postgresql/{{ pg_version }}/main/postgresql.conf"
notify: restart postgres
mode: 0644
notify: Restart postgres
- name: replace pg_hba file
copy:
- name: Replace pg_hba file
ansible.builtin.copy:
src: files/pg_hba.conf
dest: "/etc/postgresql/{{ pg_version }}/main/pg_hba.conf"
notify: restart postgres
mode: 0644
notify: Restart postgres
- name: create backup dir
file:
- name: Create backup dir
ansible.builtin.file:
path: /srv/backup/pgsql
owner: postgres
group: postgres
state: directory
mode: 0755
- name: backup pg databases
cron:
- name: Backup pg databases
ansible.builtin.cron:
user: postgres
minute: "0"
hour: "4"