taperole 1.5.5 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.hound.yml +3 -0
- data/.travis.yml +10 -0
- data/CHANGELOG.md +9 -0
- data/README.md +22 -5
- data/bin/tape +6 -0
- data/lib/tape/ansible_runner.rb +1 -0
- data/lib/tape/overwriter.rb +14 -0
- data/requirements.yml +1 -2
- data/roles/backend_install_essentials/meta/main.yml +1 -1
- data/roles/backend_install_essentials/tasks/main.yml +5 -0
- data/roles/backend_install_essentials/templates/gemrc.j2 +1 -0
- data/roles/postgres/meta/main.yml +2 -0
- data/roles/ruby/defaults/main.yml +11 -0
- data/roles/ruby/files/gemrc +5 -0
- data/{vendor/zzet.rbenv → roles/ruby}/tasks/apt_build_depends.yml +2 -3
- data/roles/ruby/tasks/main.yml +120 -0
- data/taperole.gemspec +1 -1
- data/templates/base/tape_vars.example.yml +17 -0
- data/test/base_docker_box/Dockerfile +38 -0
- data/test/rails/Dockerfile +34 -0
- data/test/rails/start_rails.sh +6 -0
- data/test/rails/tape_vars.yml +12 -0
- data/vars/defaults.yml +26 -0
- data/vendor/Stouts.backup/.bumpversion.cfg +6 -0
- data/vendor/Stouts.backup/.gitignore +1 -0
- data/vendor/Stouts.backup/.travis.yml +34 -0
- data/vendor/Stouts.backup/CONTRIBUTORS +7 -0
- data/vendor/Stouts.backup/LICENSE +21 -0
- data/vendor/Stouts.backup/Makefile +20 -0
- data/vendor/Stouts.backup/README.md +169 -0
- data/vendor/Stouts.backup/defaults/main.yml +93 -0
- data/vendor/Stouts.backup/meta/.galaxy_install_info +1 -0
- data/vendor/Stouts.backup/meta/main.yml +16 -0
- data/vendor/Stouts.backup/tasks/backup.yml +10 -0
- data/vendor/Stouts.backup/tasks/configure.yml +53 -0
- data/vendor/Stouts.backup/tasks/install.deb.yml +19 -0
- data/vendor/Stouts.backup/tasks/main.yml +5 -0
- data/vendor/Stouts.backup/tasks/remove.yml +12 -0
- data/vendor/Stouts.backup/templates/conf.j2 +78 -0
- data/vendor/Stouts.backup/templates/cron.j2 +10 -0
- data/vendor/Stouts.backup/templates/duply.sh.j2 +2240 -0
- data/vendor/Stouts.backup/templates/exclude.j2 +3 -0
- data/vendor/Stouts.backup/templates/logrotate.j2 +14 -0
- data/vendor/Stouts.backup/templates/post.j2 +14 -0
- data/vendor/Stouts.backup/templates/pre.j2 +26 -0
- data/vendor/Stouts.backup/templates/restore.j2 +29 -0
- data/vendor/Stouts.backup/test.yml +6 -0
- metadata +42 -26
- data/id_rsa_sb_basebox +0 -27
- data/vendor/zzet.rbenv/.kitchen.yml +0 -40
- data/vendor/zzet.rbenv/.travis.yml +0 -15
- data/vendor/zzet.rbenv/README.md +0 -100
- data/vendor/zzet.rbenv/defaults/main.yml +0 -20
- data/vendor/zzet.rbenv/files/default-gems +0 -1
- data/vendor/zzet.rbenv/files/gemrc +0 -4
- data/vendor/zzet.rbenv/meta/.galaxy_install_info +0 -1
- data/vendor/zzet.rbenv/meta/main.yml +0 -27
- data/vendor/zzet.rbenv/role.yml +0 -10
- data/vendor/zzet.rbenv/tasks/homebrew_build_depends.yml +0 -12
- data/vendor/zzet.rbenv/tasks/main.yml +0 -226
- data/vendor/zzet.rbenv/tasks/pacman_build_depends.yml +0 -2
- data/vendor/zzet.rbenv/tasks/yum_build_depends.yml +0 -15
- data/vendor/zzet.rbenv/test/integration/default/serverspec/rbenv_spec.rb +0 -26
- data/vendor/zzet.rbenv/test/integration/helpers/serverspec/spec_helper.rb +0 -10
- data/vendor/zzet.rbenv/test/integration/site.yml +0 -8
- data/vendor/zzet.rbenv/vars/user.yml +0 -2
- /data/{vendor/zzet.rbenv → roles/ruby}/files/vars +0 -0
- /data/{vendor/zzet.rbenv → roles/ruby}/handlers/main.yml +0 -0
- /data/{vendor/zzet.rbenv → roles/ruby}/templates/rbenv.sh.j2 +0 -0
- /data/{vendor/zzet.rbenv → roles/ruby}/vars/main.yml +0 -0
- /data/{vendor/zzet.rbenv → roles/ruby}/vars/system.yml +0 -0
@@ -0,0 +1,169 @@
|
|
1
|
+
Stouts.backup
|
2
|
+
=============
|
3
|
+
|
4
|
+
[](https://travis-ci.org/Stouts/Stouts.backup)
|
5
|
+
[](https://galaxy.ansible.com/list#/roles/945)
|
6
|
+
|
7
|
+
Ansible role which manage backups. Support file backups, postgresql, mysql, mongo db backups.
|
8
|
+
|
9
|
+
|
10
|
+
## Variables
|
11
|
+
|
12
|
+
The role variables and default values.
|
13
|
+
|
14
|
+
```yaml
|
15
|
+
backup_enabled: yes # Enable the role
|
16
|
+
backup_remove: no # Set yes for uninstall the role from target system
|
17
|
+
|
18
|
+
backup_user: root # Run backups as user
|
19
|
+
backup_group: "{{backup_user}}"
|
20
|
+
|
21
|
+
backup_home: /etc/duply # Backup configuration directory
|
22
|
+
backup_work: /var/duply # Working directory
|
23
|
+
|
24
|
+
backup_duplicity_ppa: ppa:duplicity-team/ppa # Set empty for skipping PPA addition
|
25
|
+
backup_duplicity_pkg: duplicity
|
26
|
+
backup_duplicity_version: # Set duplicity version
|
27
|
+
|
28
|
+
# Logging
|
29
|
+
backup_logdir: /var/log/duply # Place where logs will be keepped
|
30
|
+
backup_logrotate: yes # Setup logs rotation
|
31
|
+
|
32
|
+
# Posgresql
|
33
|
+
backup_postgres_user: postgres
|
34
|
+
backup_postgres_host: ""
|
35
|
+
|
36
|
+
# Mysql
|
37
|
+
backup_mysql_user: mysql
|
38
|
+
backup_mysql_pass: ""
|
39
|
+
|
40
|
+
backup_profiles: [] # Setup backup profiles
|
41
|
+
# Ex. backup_profiles:
|
42
|
+
# - name: www # required param
|
43
|
+
# schedule: 0 0 * * 0 # if defined enabled cronjob
|
44
|
+
# source: /var/www
|
45
|
+
# max_age: 10D
|
46
|
+
# target: s3://my.bucket/www
|
47
|
+
# params:
|
48
|
+
# - "BEST_PASSWORD={{ best_password }}"
|
49
|
+
# exclude:
|
50
|
+
# - *.pyc
|
51
|
+
# - name: postgresql
|
52
|
+
# schedule: 0 4 * * *
|
53
|
+
# action: restore # Choose action: backup/restore (default is backup)
|
54
|
+
# source: postgresql://db_name
|
55
|
+
# target: s3://my.bucket/postgresql
|
56
|
+
|
57
|
+
# Default values (overide them in backup profiles bellow)
|
58
|
+
# =======================================================
|
59
|
+
# (every value can be replaced in jobs individually)
|
60
|
+
|
61
|
+
# GPG
|
62
|
+
backup_gpg_key: disabled
|
63
|
+
backup_gpg_pw: ""
|
64
|
+
backup_gpg_opts: ''
|
65
|
+
|
66
|
+
# TARGET
|
67
|
+
# syntax is
|
68
|
+
# scheme://[user:password@]host[:port]/[/]path
|
69
|
+
# probably one out of
|
70
|
+
# file://[/absolute_]path
|
71
|
+
# ftp[s]://user[:password]@other.host[:port]/some_dir
|
72
|
+
# hsi://user[:password]@other.host/some_dir
|
73
|
+
# cf+http://container_name
|
74
|
+
# imap[s]://user[:password]@host.com[/from_address_prefix]
|
75
|
+
# rsync://user[:password]@other.host[:port]::/module/some_dir
|
76
|
+
# rsync://user@other.host[:port]/relative_path
|
77
|
+
# rsync://user@other.host[:port]//absolute_path
|
78
|
+
# # for the s3 user/password are AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY
|
79
|
+
# s3://[user:password]@host/bucket_name[/prefix]
|
80
|
+
# s3+http://[user:password]@bucket_name[/prefix]
|
81
|
+
# ssh://user[:password]@other.host[:port]/some_dir
|
82
|
+
# tahoe://alias/directory
|
83
|
+
# webdav[s]://user[:password]@other.host/some_dir
|
84
|
+
backup_target: 'file:///var/backup'
|
85
|
+
# optionally the username/password can be defined as extra variables
|
86
|
+
backup_target_user:
|
87
|
+
backup_target_pass:
|
88
|
+
|
89
|
+
# Time frame for old backups to keep, Used for the "purge" command.
|
90
|
+
# see duplicity man page, chapter TIME_FORMATS)
|
91
|
+
backup_max_age: 1M
|
92
|
+
|
93
|
+
# Number of full backups to keep. Used for the "purge-full" command.
|
94
|
+
# See duplicity man page, action "remove-all-but-n-full".
|
95
|
+
backup_max_full_backups: 1
|
96
|
+
|
97
|
+
# forces a full backup if last full backup reaches a specified age
|
98
|
+
backup_full_max_age: 1M
|
99
|
+
|
100
|
+
# set the size of backup chunks to VOLSIZE MB instead of the default 25MB.
|
101
|
+
backup_volsize: 50
|
102
|
+
|
103
|
+
# verbosity of output (error 0, warning 1-2, notice 3-4, info 5-8, debug 9)
|
104
|
+
backup_verbosity: 3
|
105
|
+
|
106
|
+
backup_exclude: [] # List of filemasks to exlude
|
107
|
+
```
|
108
|
+
|
109
|
+
## Usage
|
110
|
+
|
111
|
+
Add `Stouts.backup` to your roles and set variables in your playbook file.
|
112
|
+
|
113
|
+
Example:
|
114
|
+
|
115
|
+
```yaml
|
116
|
+
|
117
|
+
- hosts: all
|
118
|
+
|
119
|
+
roles:
|
120
|
+
- Stouts.backup
|
121
|
+
|
122
|
+
vars:
|
123
|
+
backup_target_user: aws_access_key
|
124
|
+
backup_target_pass: aws_secret
|
125
|
+
backup_profiles:
|
126
|
+
|
127
|
+
# Backup file path
|
128
|
+
- name: uploads # Required params
|
129
|
+
schedule: 0 3 * * * # At 3am every day
|
130
|
+
source: /usr/lib/project/uploads
|
131
|
+
target: s3://s3-eu-west-1.amazonaws.com/backup.backet/{{inventory_hostname}}/uploads
|
132
|
+
|
133
|
+
# Backup postgresql database
|
134
|
+
- name: postgresql
|
135
|
+
schedule: 0 4 * * * # At 4am every day
|
136
|
+
source: postgresql://project # Backup prefixes: postgresql://, maysql://, mongo://
|
137
|
+
target: s3://s3-eu-west-1.amazonaws.com/backup.backet/{{inventory_hostname}}/postgresql
|
138
|
+
user: postgres
|
139
|
+
|
140
|
+
```
|
141
|
+
|
142
|
+
### Manage backups manually
|
143
|
+
|
144
|
+
Run backup for profile `uploads` manually:
|
145
|
+
|
146
|
+
$ duply uploads backup
|
147
|
+
|
148
|
+
Load backup for profile `postgresql` from cloud and restore database (logged as postgres user)
|
149
|
+
|
150
|
+
$ duply postgresql restore
|
151
|
+
|
152
|
+
Also see `duply usage`
|
153
|
+
|
154
|
+
|
155
|
+
## License
|
156
|
+
|
157
|
+
Licensed under the MIT License. See the LICENSE file for details.
|
158
|
+
|
159
|
+
## Feedback, bug-reports, requests, ...
|
160
|
+
|
161
|
+
Are [welcome](https://github.com/Stouts/Stouts.backup/issues)!
|
162
|
+
|
163
|
+
If you wish to express your appreciation for the role, you are welcome to send
|
164
|
+
a postcard to:
|
165
|
+
|
166
|
+
Kirill Klenov
|
167
|
+
pos. Severny 8-3
|
168
|
+
MO, Istra, 143500
|
169
|
+
Russia
|
@@ -0,0 +1,93 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
backup_enabled: yes # Enable the role
|
4
|
+
backup_remove: no # Set yes for uninstall the role from target system
|
5
|
+
|
6
|
+
backup_user: root # Run backups as user
|
7
|
+
backup_group: "{{backup_user}}"
|
8
|
+
|
9
|
+
backup_home: /etc/duply # Backup configuration directory
|
10
|
+
backup_work: /var/duply # Working directory
|
11
|
+
|
12
|
+
backup_duplicity_ppa: ppa:duplicity-team/ppa # Set empty for skipping PPA addition
|
13
|
+
backup_duplicity_pkg: duplicity
|
14
|
+
backup_duplicity_version: # Set duplicity version
|
15
|
+
|
16
|
+
# Logging
|
17
|
+
backup_logdir: /var/log/duply # Place where logs will be keepped
|
18
|
+
backup_logrotate: yes # Setup logs rotation
|
19
|
+
|
20
|
+
# Posgresql
|
21
|
+
backup_postgres_user: postgres
|
22
|
+
backup_postgres_host: ""
|
23
|
+
backup_postgres_port: 5432
|
24
|
+
|
25
|
+
# Mysql
|
26
|
+
backup_mysql_user: mysql
|
27
|
+
backup_mysql_pass: ""
|
28
|
+
|
29
|
+
backup_profiles: [] # Setup backup profiles
|
30
|
+
# Ex. backup_profiles:
|
31
|
+
# - name: www # required param
|
32
|
+
# schedule: 0 0 * * 0 # if defined enabled cronjob
|
33
|
+
# source: /var/www
|
34
|
+
# max_age: 10D
|
35
|
+
# target: s3://my.bucket/www
|
36
|
+
# exclude:
|
37
|
+
# - *.pyc
|
38
|
+
# - name: postgresql
|
39
|
+
# schedule: 0 4 * * *
|
40
|
+
# action: restore # Choose action: backup/restore (default is backup)
|
41
|
+
# source: postgresql://db_name
|
42
|
+
# target: s3://my.bucket/postgresql
|
43
|
+
|
44
|
+
# Default values (overide them in backup profiles bellow)
|
45
|
+
# =======================================================
|
46
|
+
# (every value can be replaced in jobs individually)
|
47
|
+
|
48
|
+
# GPG
|
49
|
+
backup_gpg_key: disabled
|
50
|
+
backup_gpg_pw: ""
|
51
|
+
backup_gpg_opts: ''
|
52
|
+
|
53
|
+
# TARGET
|
54
|
+
# syntax is
|
55
|
+
# scheme://[user:password@]host[:port]/[/]path
|
56
|
+
# probably one out of
|
57
|
+
# file://[/absolute_]path
|
58
|
+
# ftp[s]://user[:password]@other.host[:port]/some_dir
|
59
|
+
# hsi://user[:password]@other.host/some_dir
|
60
|
+
# cf+http://container_name
|
61
|
+
# imap[s]://user[:password]@host.com[/from_address_prefix]
|
62
|
+
# rsync://user[:password]@other.host[:port]::/module/some_dir
|
63
|
+
# rsync://user@other.host[:port]/relative_path
|
64
|
+
# rsync://user@other.host[:port]//absolute_path
|
65
|
+
# # for the s3 user/password are AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY
|
66
|
+
# s3://[user:password]@host/bucket_name[/prefix]
|
67
|
+
# s3+http://[user:password]@bucket_name[/prefix]
|
68
|
+
# ssh://user[:password]@other.host[:port]/some_dir
|
69
|
+
# tahoe://alias/directory
|
70
|
+
# webdav[s]://user[:password]@other.host/some_dir
|
71
|
+
backup_target: 'file:///var/backup'
|
72
|
+
# optionally the username/password can be defined as extra variables
|
73
|
+
backup_target_user:
|
74
|
+
backup_target_pass:
|
75
|
+
|
76
|
+
# Time frame for old backups to keep, Used for the "purge" command.
|
77
|
+
# see duplicity man page, chapter TIME_FORMATS)
|
78
|
+
backup_max_age: 1M
|
79
|
+
|
80
|
+
# Number of full backups to keep. Used for the "purge-full" command.
|
81
|
+
# See duplicity man page, action "remove-all-but-n-full".
|
82
|
+
backup_max_full_backups: 1
|
83
|
+
|
84
|
+
# forces a full backup if last full backup reaches a specified age
|
85
|
+
backup_full_max_age: 1M
|
86
|
+
|
87
|
+
# set the size of backup chunks to VOLSIZE MB instead of the default 25MB.
|
88
|
+
backup_volsize: 50
|
89
|
+
|
90
|
+
# verbosity of output (error 0, warning 1-2, notice 3-4, info 5-8, debug 9)
|
91
|
+
backup_verbosity: 3
|
92
|
+
|
93
|
+
backup_exclude: [] # List of filemasks to exlude
|
@@ -0,0 +1 @@
|
|
1
|
+
{install_date: 'Mon May 16 16:58:23 2016', version: 3.3.0}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
dependencies: []
|
4
|
+
|
5
|
+
galaxy_info:
|
6
|
+
author: klen
|
7
|
+
company: Stouts
|
8
|
+
description: Backup system. Files, dirs, databases. Upload to clouds.
|
9
|
+
license: MIT
|
10
|
+
platforms:
|
11
|
+
- name: Ubuntu
|
12
|
+
versions:
|
13
|
+
- all
|
14
|
+
categories:
|
15
|
+
- system
|
16
|
+
- cloud
|
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
- name: backup-configure | Ensure for backup user is exists
|
4
|
+
user: name={{backup_user}}
|
5
|
+
|
6
|
+
- name: backup-configure | Ensure for backup directories is exits
|
7
|
+
file: path={{item}} state=directory owner={{backup_user}} group={{backup_group}}
|
8
|
+
with_items:
|
9
|
+
- "{{backup_home}}"
|
10
|
+
- "{{backup_work}}"
|
11
|
+
- "{{backup_logdir}}"
|
12
|
+
|
13
|
+
- name: backup-configure | Install duply
|
14
|
+
template: src=duply.sh.j2 dest=/usr/local/bin/duply owner={{backup_user}} group={{backup_group}} mode=0755
|
15
|
+
|
16
|
+
- name: backup-configure | Create profile directories
|
17
|
+
file: path={{backup_home}}/{{item.name}} state=directory mode=0700 owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
18
|
+
with_items: backup_profiles
|
19
|
+
|
20
|
+
- name: backup-configure | Configure profiles
|
21
|
+
template: src=conf.j2 dest={{backup_home}}/{{item.name}}/conf owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
22
|
+
with_items: backup_profiles
|
23
|
+
|
24
|
+
- name: backup-configure | Configure exclude lists
|
25
|
+
template: src=exclude.j2 dest={{backup_home}}/{{item.name}}/exclude owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
26
|
+
with_items: backup_profiles
|
27
|
+
|
28
|
+
- name: backup-configure | Configure pre scripts
|
29
|
+
template: src=pre.j2 dest={{backup_home}}/{{item.name}}/pre owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
30
|
+
with_items: backup_profiles
|
31
|
+
|
32
|
+
- name: backup-configure | Configure post scripts
|
33
|
+
template: src=post.j2 dest={{backup_home}}/{{item.name}}/post owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
34
|
+
with_items: backup_profiles
|
35
|
+
|
36
|
+
- name: backup-configure | Configure restore scripts
|
37
|
+
template: src=restore.j2 dest={{backup_home}}/{{item.name}}/restore owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
38
|
+
with_items: backup_profiles
|
39
|
+
|
40
|
+
- name: backup-configure | Create work directories
|
41
|
+
file: state=directory path={{backup_work}}/{{item.name}} owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
42
|
+
with_items: backup_profiles
|
43
|
+
|
44
|
+
- name: backup-configure | Setup cron
|
45
|
+
template: src=cron.j2 dest=/etc/cron.d/backup owner=root group=root mode=0644
|
46
|
+
|
47
|
+
- name: backup-configure | Create log files
|
48
|
+
file: state=touch path={{backup_logdir}}/{{item.name}}.log owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
49
|
+
with_items: backup_profiles
|
50
|
+
changed_when: False
|
51
|
+
|
52
|
+
- name: backup-configure | Configure logrotate
|
53
|
+
template: src=logrotate.j2 dest=/etc/logrotate.d/backup owner=root group=root mode=0644
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
- name: Add duplicity ppa
|
4
|
+
apt_repository: repo='{{ backup_duplicity_ppa }}' update_cache=yes
|
5
|
+
when: backup_duplicity_ppa
|
6
|
+
|
7
|
+
- name: Install dependencies
|
8
|
+
apt: pkg={{item}}
|
9
|
+
with_items:
|
10
|
+
- cron
|
11
|
+
- gzip
|
12
|
+
- python-boto
|
13
|
+
- s3cmd
|
14
|
+
|
15
|
+
- set_fact: backup_duplicity_pkg="{{backup_duplicity_pkg}}={{backup_duplicity_version}}"
|
16
|
+
when: backup_duplicity_version
|
17
|
+
|
18
|
+
- name: Install duplicity
|
19
|
+
apt: pkg={{backup_duplicity_pkg}}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
# Uninstall the role
|
3
|
+
|
4
|
+
- name: Uninstall the role - pt. 1
|
5
|
+
file: state=absent path=/etc/cron.d/backup
|
6
|
+
|
7
|
+
- name: Uninstall the role - pt. 2
|
8
|
+
file: state=absent path={{item}}
|
9
|
+
with_items:
|
10
|
+
- "{{backup_home}}"
|
11
|
+
- "{{backup_work}}"
|
12
|
+
- "{{backup_logdir}}"
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# This file was generated by Ansible for {{ ansible_fqdn }}
|
2
|
+
# Do NOT modify this file by hand!
|
3
|
+
|
4
|
+
# Setting only a passphrase and omitting the GPG key
|
5
|
+
# will enable symmetric passphrase-only encryption.
|
6
|
+
{% if item.gpg_key|default(backup_gpg_key) == 'disabled' and item.gpg_pw|default(backup_gpg_pw) %}
|
7
|
+
# GPG_KEY='{{ item.gpg_key|default(backup_gpg_key) }}'
|
8
|
+
{% else %}
|
9
|
+
GPG_KEY='{{ item.gpg_key|default(backup_gpg_key) }}'
|
10
|
+
{% endif %}
|
11
|
+
GPG_PW='{{ item.gpg_pw|default(backup_gpg_pw) }}'
|
12
|
+
{% if item.gpg_keys_enc|default(None) %}
|
13
|
+
GPG_KEYS_ENC='{{item.gpg_keys_enc}}'
|
14
|
+
{% endif %}
|
15
|
+
{% if item.gpg_key_sign|default(None) %}
|
16
|
+
GPG_KEY_SIGN='{{item.gpg_key_sign}}'
|
17
|
+
{% endif %}
|
18
|
+
{% if item.gpg_pw_sign|default(None) %}
|
19
|
+
GPG_PW_SIGN='{{item.gpg_pw_sign}}'
|
20
|
+
{% endif %}
|
21
|
+
GPG_OPTS='{{item.gpg_opts|default(backup_gpg_opts)}}'
|
22
|
+
|
23
|
+
TARGET='{{item.target|default(backup_target)}}'
|
24
|
+
|
25
|
+
{% if item.target_user|default(backup_target_user) %}
|
26
|
+
TARGET_USER='{{item.target_user|default(backup_target_user)}}'
|
27
|
+
{% endif %}
|
28
|
+
{% if item.target_pass|default(backup_target_pass) %}
|
29
|
+
TARGET_PASS='{{item.target_pass|default(backup_target_pass)}}'
|
30
|
+
{% endif %}
|
31
|
+
|
32
|
+
{% if item.source.startswith('postgresql://') or item.source.startswith('mysql://') or item.source.startswith('mongo://') %}
|
33
|
+
SOURCE='{{backup_work}}/{{item.name}}/dump'
|
34
|
+
{% else %}
|
35
|
+
SOURCE='{{item.source|default(backup_source)}}'
|
36
|
+
{% endif %}
|
37
|
+
|
38
|
+
# Time frame for old backups to keep, Used for the "purge" command.
|
39
|
+
# see duplicity man page, chapter TIME_FORMATS)
|
40
|
+
MAX_AGE='{{item.max_age|default(backup_max_age)}}'
|
41
|
+
|
42
|
+
# Number of full backups to keep. Used for the "purge-full" command.
|
43
|
+
# See duplicity man page, action "remove-all-but-n-full".
|
44
|
+
MAX_FULL_BACKUPS='{{item.max_full_backups|default(backup_max_full_backups)}}'
|
45
|
+
|
46
|
+
VERBOSITY={{item.verbosity|default(backup_verbosity)}}
|
47
|
+
|
48
|
+
# ARCH_DIR=/tmp/backup_{{item.name}}
|
49
|
+
|
50
|
+
# activates duplicity --full-if-older-than option (since duplicity v0.4.4.RC3)
|
51
|
+
# forces a full backup if last full backup reaches a specified age, for the
|
52
|
+
# format of MAX_FULLBKP_AGE see duplicity man page, chapter TIME_FORMATS
|
53
|
+
MAX_FULLBKP_AGE={{ item.full_max_age|default(backup_full_max_age) }}
|
54
|
+
DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE "
|
55
|
+
|
56
|
+
# sets duplicity --volsize option (available since v0.4.3.RC7)
|
57
|
+
# set the size of backup chunks to VOLSIZE MB instead of the default 25MB.
|
58
|
+
# VOLSIZE must be number of MB's to set the volume size to.
|
59
|
+
VOLSIZE={{ item.volsize|default(backup_volsize) }}
|
60
|
+
DUPL_PARAMS="$DUPL_PARAMS --volsize $VOLSIZE "
|
61
|
+
|
62
|
+
# exclude folders containing exclusion file (since duplicity 0.5.14)
|
63
|
+
# Uncomment the following two lines to enable this setting.
|
64
|
+
#FILENAME='.duplicity-ignore'
|
65
|
+
#DUPL_PARAMS="$DUPL_PARAMS --exclude-if-present '$FILENAME'"
|
66
|
+
|
67
|
+
# Add params needed for target or backup process.
|
68
|
+
{% for param in item.params|default([]) %}
|
69
|
+
{{ param }}
|
70
|
+
{% endfor %}
|
71
|
+
|
72
|
+
# temporary file space. at least the size of the biggest file in backup
|
73
|
+
# for a successful restoration process. (default is '/tmp', if not set)
|
74
|
+
#TEMP_DIR=/tmp
|
75
|
+
|
76
|
+
# more duplicity command line options can be added in the following way
|
77
|
+
# don't forget to leave a separating space char at the end
|
78
|
+
#DUPL_PARAMS="$DUPL_PARAMS --put_your_options_here "
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This file was generated by Ansible for {{ ansible_fqdn }}
|
2
|
+
# Do NOT modify this file by hand!
|
3
|
+
|
4
|
+
# Run backups
|
5
|
+
{% for profile in backup_profiles %}
|
6
|
+
{% if profile.schedule|default(None) %}
|
7
|
+
{{profile.schedule}} {{profile.user|default(backup_user)}} /usr/local/bin/duply {{backup_home}}/{{profile.name}} {{profile.action|default('backup')}} >> {{backup_logdir}}/{{profile.name}}.log 2>&1
|
8
|
+
{% endif %}
|
9
|
+
{% endfor %}
|
10
|
+
|