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 - name: Restart postgres
service: ansible.builtin.service:
name: "postgresql@{{ pg_version }}-main" name: "postgresql@{{ pg_version }}-main"
state: restarted state: restarted

View File

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