style: linting
This commit is contained in:
@@ -1 +1,3 @@
|
||||
---
|
||||
|
||||
pg_version: "{% if ansible_facts['os_family'] == 'Debian' and ansible_facts['distribution_major_version'] == '9' %}9.6{% elif ansible_facts['os_family'] == 'Debian' and ansible_facts['distribution_major_version'] == '10' %}11{% elif ansible_facts['os_family'] == 'Debian' and ansible_facts['distribution_major_version'] == '11' %}13{% endif %}"
|
||||
|
@@ -1,4 +1,6 @@
|
||||
---
|
||||
|
||||
- name: restart postgres
|
||||
service:
|
||||
name: "postgresql@{{ pg_version }}-main"
|
||||
state: restarted
|
||||
name: "postgresql@{{ pg_version }}-main"
|
||||
state: restarted
|
||||
|
@@ -1,7 +1,9 @@
|
||||
---
|
||||
|
||||
- name: install postgresql
|
||||
package:
|
||||
name: postgresql
|
||||
state: present
|
||||
name: postgresql
|
||||
state: present
|
||||
|
||||
- name: create pgsql directory
|
||||
file:
|
||||
@@ -12,35 +14,35 @@
|
||||
|
||||
- name: populate postgresql directory
|
||||
command: "/usr/lib/postgresql/{{ pg_version }}/bin/initdb -E UTF-8 /srv/postgresql/"
|
||||
become: yes
|
||||
become: true
|
||||
become_user: postgres
|
||||
args:
|
||||
creates: /srv/postgresql/PG_VERSION
|
||||
creates: /srv/postgresql/PG_VERSION
|
||||
notify: restart postgres
|
||||
|
||||
- name: replace main conffile
|
||||
copy:
|
||||
src: files/postgresql.conf
|
||||
dest: "/etc/postgresql/{{ pg_version }}/main/postgresql.conf"
|
||||
src: files/postgresql.conf
|
||||
dest: "/etc/postgresql/{{ pg_version }}/main/postgresql.conf"
|
||||
notify: restart postgres
|
||||
|
||||
- name: replace pg_hba file
|
||||
copy:
|
||||
src: files/pg_hba.conf
|
||||
dest: "/etc/postgresql/{{ pg_version }}/main/pg_hba.conf"
|
||||
src: files/pg_hba.conf
|
||||
dest: "/etc/postgresql/{{ pg_version }}/main/pg_hba.conf"
|
||||
notify: restart postgres
|
||||
|
||||
- name: create backup dir
|
||||
file:
|
||||
path: /srv/backup/pgsql
|
||||
owner: postgres
|
||||
group: postgres
|
||||
state: directory
|
||||
path: /srv/backup/pgsql
|
||||
owner: postgres
|
||||
group: postgres
|
||||
state: directory
|
||||
|
||||
- name: backup pg databases
|
||||
cron:
|
||||
user: postgres
|
||||
minute: "0"
|
||||
hour: "4"
|
||||
name: PG Backup
|
||||
job: "/usr/bin/pg_dumpall | gzip -c > /srv/backup/pgsql/all.dbs.gz"
|
||||
user: postgres
|
||||
minute: "0"
|
||||
hour: "4"
|
||||
name: PG Backup
|
||||
job: "/usr/bin/pg_dumpall | gzip -c > /srv/backup/pgsql/all.dbs.gz"
|
||||
|
Reference in New Issue
Block a user