Changeset - de825c5e17de
[Not reviewed]
0 3 1
Branko Majic (branko) - 8 years ago 2016-01-18 23:13:16
branko@majic.rs
MAR-44: Redisgned how backup client handles backup pattern deployment. Introduce a list parameter for this purpose to the role. Updated docs.
4 files changed with 21 insertions and 4 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -1514,10 +1514,9 @@ Duply is configured as follows:
 
  location ``/etc/duply/main/ssh/known_hosts``.
 
* Base directory for back-ups is root (``/``), but *all* files are excluded by
 
  default to prevent huge back-ups. Ansible roles that want to utilise the
 
  backup client role can specify patterns to include by adding pattern file to
 
  directory ``/etc/duply/main/patterns/``. It is recommended to name such a file
 
  after the role name. Include pattern file is assembled from these snippets and
 
  stored in location ``/etc/duply/main/include``.
 
  backup client role can specify which patterns should be included in the backup
 
  when including the role. Include pattern file is assembled and stored in
 
  location ``/etc/duply/main/include``.
 
* Backups are encrypted and signed with the specified encryption key.
 
* Maximum age for old backups is set to 6 months.
 
* Maximum age for full backups is set to 1 month.
 
@@ -1557,6 +1556,16 @@ Parameters
 
  to destination server and that can be also used for the restore operations
 
  (for data decryption). The key must not be password-protected.
 

	
 
**backup_patterns_name** (string, mandatory)
 
  Name of the backup patterns file. The file is stored in directory
 
  ``/etc/duply/main/patterns/``. This should be a unique filename amongst all
 
  roles. If role can be included multiple times, make sure the filename is
 
  always unique when depending on the backup client role.
 

	
 
**backup_patterns** (list, optional, ``[]``)
 
  List of globbing patterns defining which file or directories should be
 
  backed-up.
 

	
 
**backup_server** (string, mandatory)
 
  Backup server to connect to.
 

	
roles/backup_client/defaults/main.yml
Show inline comments
 
@@ -2,5 +2,6 @@
 

	
 
backup_additional_encryption_keys: []
 
backup_client_username: "bak-{{ ansible_fqdn | replace('.', '_') }}"
 
backup_patterns: []
 
backup_server_destination: //duplicity
 
backup_server_port: 2222
roles/backup_client/tasks/main.yml
Show inline comments
 
@@ -61,6 +61,10 @@
 
  copy: content="- **" dest="/etc/duply/main/exclude"
 
        owner="root" group="root" mode="600"
 

	
 
- name: Configure backup patterns
 
  template: src="backup_patterns.j2" dest="/etc/duply/main/patterns/{{ backup_patterns_filename }}"
 
            owner="root" group="root" mode=700
 

	
 
- name: Assemble Duply include patterns
 
  assemble: src="/etc/duply/main/patterns" dest="/etc/duply/main/include"
 
            owner="root" group="root" mode="600"
roles/backup_client/templates/backup_patterns.j2
Show inline comments
 
new file 100644
 
{% for pattern in backup_patterns  -%}
 
{{ pattern }}
 
{% endfor -%}
 
\ No newline at end of file
0 comments (0 inline, 0 general)