Cron backups for db-datanommer01.
This commit is contained in:
parent
18100deb21
commit
12b88b57a1
4 changed files with 21 additions and 0 deletions
|
@ -39,6 +39,9 @@ virt_install_command: /usr/sbin/virt-install -n {{ inventory_hostname }} -r {{ m
|
|||
# By default, nodes get no fedmsg certs. They need to declare them explicitly.
|
||||
fedmsg_certs: []
|
||||
|
||||
# By default, nodes don't backup any dbs on them unless they declare it.
|
||||
dbs_to_backup: []
|
||||
|
||||
# by default the number of procs we allow before we whine
|
||||
nrpe_procs_warn: 175
|
||||
nrpe_procs_crit: 200
|
||||
|
|
|
@ -8,6 +8,10 @@ volgroup: /dev/vg_guests00
|
|||
eth0_ip: 10.5.126.109
|
||||
vmhost: virthost14.phx2.fedoraproject.org
|
||||
datacenter: phx2
|
||||
|
||||
dbs_to_backup:
|
||||
- datanommer
|
||||
|
||||
# These are normally group variables, but in this case db servers are often different
|
||||
lvm_size: 300000
|
||||
mem_size: 8192
|
||||
|
|
|
@ -32,3 +32,16 @@
|
|||
- restart postgresql
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: Ensure postgres has a place to backup to
|
||||
file: dest=/backups state=directory owner=postgres
|
||||
|
||||
- name: Set up some cronjobs to backup databases as configured
|
||||
template: >
|
||||
src=cron-backup-database
|
||||
dest=/etc/cron.d/cron-backup-database-{{ item }}
|
||||
with_items:
|
||||
- "{{ dbs_to_backup }}"
|
||||
when: dbs_to_backup != []
|
||||
tags:
|
||||
- cron
|
||||
|
|
1
roles/postgresql_server/templates/cron-backup-database
Normal file
1
roles/postgresql_server/templates/cron-backup-database
Normal file
|
@ -0,0 +1 @@
|
|||
0 0 * * * postgres /usr/bin/pg_dump -C {{ item }} | /usr/bin/xz > /backups/{{ item }}-$(date +%F).dump.xz
|
Loading…
Add table
Add a link
Reference in a new issue