File tree Expand file tree Collapse file tree 2 files changed +42
-2
lines changed
provision-contest/ansible Expand file tree Collapse file tree 2 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 77 exit 1
88fi
99
10- FILE=" /home/domjudge/db-dumps/${1} .sql.gz"
10+ FILEHOME=" /home/domjudge/db-dumps/${1} .sql.gz"
11+ FILEBACKUP=" /home/domjudge/db-dumps-backup/${1} .sql.gz"
1112
12- if [ ! -f " ${FILE} " ]
13+ if [ -f " ${FILEHOME} " ]
14+ then
15+ FILE=" ${FILEHOME} "
16+ elif [ -f " ${FILEBACKUP} " ]
17+ then
18+ FILE=" ${FILEBACKUP} "
19+ fi
20+
21+ if [ -z " ${FILE++} " ] || [ ! -f " ${FILE} " ]
1322then
1423 echo " Error. File ${FILE} not found"
1524 exit 1
Original file line number Diff line number Diff line change 1+ ---
2+ - hosts : domserver
3+ tasks :
4+ - name : Create directory to collect backups
5+ file :
6+ state : directory
7+ owner : root
8+ group : root
9+ mode : 0755
10+ path : " /srv/db-dumps"
11+
12+ - name : Download dumps to ansible machine
13+ synchronize :
14+ mode : pull
15+ src : " /home/domjudge/db-dumps/"
16+ dest : " /srv/db-dumps/"
17+
18+ - hosts : admin
19+ tasks :
20+ - name : Create directory to collect backups
21+ file :
22+ state : directory
23+ owner : domjudge
24+ group : domjudge
25+ mode : 0755
26+ path : " /home/domjudge/db-dumps-backup"
27+
28+ - name : Download dumps to admin machines
29+ synchronize :
30+ dest : " /home/domjudge/db-dumps-backup/"
31+ src : " /srv/db-dumps/"
You can’t perform that action at this time.
0 commit comments