updates
This commit is contained in:
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd /tmp
|
||||
|
||||
test -d /var/lib/pgsql || exit 0
|
||||
|
||||
pgrep postgres &>/dev/null || exit 10
|
||||
|
||||
tar -jcvf /var/backups/postgres/postgresql-config.tbz2 /var/lib/pgsql/*/data/*.conf
|
||||
|
||||
/usr/sbin/runuser postgres -l -s /bin/bash -c '/usr/bin/pg_dumpall > /var/backups/postgres/pgdump.sql'
|
||||
|
||||
+5
-2
@@ -56,13 +56,16 @@
|
||||
ansible.builtin.selinux:
|
||||
state: disabled
|
||||
|
||||
- name: Create bin directory
|
||||
- name: Create Directories
|
||||
file:
|
||||
path: /opt/atclab/bin
|
||||
path: '{{ item }}'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: root
|
||||
group: root
|
||||
loop:
|
||||
- /var/backups
|
||||
- /opt/atclab/bin
|
||||
|
||||
- name: Copy etc configs
|
||||
copy:
|
||||
|
||||
@@ -50,6 +50,9 @@ atc-mgt01.dell-atc.lan
|
||||
atc-nas.dell-atc.lan
|
||||
atc-db01.dell-atc.lan
|
||||
|
||||
[postgres]
|
||||
atc-db01.dell-atc.lan
|
||||
|
||||
[nvidia]
|
||||
atc-gpu-bart.dell-atc.lan
|
||||
atc-gpu-mo1.dell-atc.lan
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Postgres Servers
|
||||
hosts: postgres
|
||||
pre_tasks:
|
||||
- name: Postgres Repo
|
||||
ansible.builtin.dnf:
|
||||
name: 'https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm'
|
||||
state: present
|
||||
|
||||
tasks:
|
||||
- name: Backup script
|
||||
copy:
|
||||
src: 'bin/pg-backup'
|
||||
dest: '/usr/local/bin/pg-backup'
|
||||
mode: '0755'
|
||||
|
||||
- name: Setup Postgres backup cron job
|
||||
ansible.builtin.cron:
|
||||
name: "borgmatic"
|
||||
minute: 30
|
||||
hour: 23
|
||||
job: /usr/local/bin/pg-backup
|
||||
|
||||
Reference in New Issue
Block a user