Changeset - 7742feee3781
[Not reviewed]
0 8 0
Branko Majic (branko) - 8 years ago 2016-01-18 23:31:50
branko@majic.rs
MAR-44: Updated the name of backup_client parameter to be more clear (backup_patterns_name to backup_patterns_filename). Removed unused handler from backup clients role.
8 files changed with 16 insertions and 31 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -1556,7 +1556,7 @@ 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)
 
**backup_patterns_filename** (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
docs/usage.rst
Show inline comments
 
@@ -2023,35 +2023,24 @@ before every backup run the database is dumped and stored in location
 
What is not backed-up for us, though, are the files uploaded to *The Bug
 
Genie*. So let's fix that one.
 

	
 
1. Add the backup client role to list of dependencies.
 
1. Add the backup client role to list of dependencies. It is important to define
 
   unique filename for the backup patterns. Take into account that you can use
 
   pretty much any globbing pattern supported by Duplicity.
 

	
 
   :file:`~/mysite/roles/tbg/meta/main.yml`
 
   ::
 

	
 
        - role: backup_client
 
          when: enable_backup
 
          backup_patterns_filename: "tbg"
 
          backup_patterns:
 
            - "/var/www/tbg.example.com/files"
 

	
 
2. Add task to the ``tbg`` role that deploys file containing additional patterns
 
   that should be backed-up from the disk during backup runs:
 

	
 
   :file:`~/mysite/roles/tbg/tasks/main.yml`
 
   ::
 

	
 
      - name: Configure back-up of The Bug Genie uploaded files
 
        copy: content="/var/www/tbg.example.com/files" dest="/etc/duply/main/patterns/tbg"
 
              owner="root" group="root" mode=600
 
        notify:
 
          - Assemble Duply include patterns
 

	
 
   .. warning:: Don't forget to notify the ``Assemble Duply include patterns``
 
                handler! This handler will collect all the different patterns
 
                deployed by various roles in a single place for backup software
 
                to pick-up.
 

	
 
3. Apply the changes::
 
2. Apply the changes::
 

	
 
     workon mysite && ansible-playbook playbooks/site.yml
 

	
 
4. Now rerun the backup on server ``www.example.com`` (as root). If you haven't
 
3. Now rerun the backup on server ``www.example.com`` (as root). If you haven't
 
   uploaded any files, you may want to do so before testing to make sure
 
   something is backed-up.
 

	
 
@@ -2059,7 +2048,7 @@ Genie*. So let's fix that one.
 

	
 
     duply main backup
 

	
 
5. Verify that the files have been backed-up:
 
4. Verify that the files have been backed-up:
 

	
 
   ::
 

	
roles/backup_client/tasks/main.yml
Show inline comments
 
@@ -65,10 +65,6 @@
 
  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"
 

	
 
- name: Set-up directory for storing pre-backup scripts
 
  file: path="/etc/duply/main/pre.d/" state=directory
 
        owner="root" group="root" mode="700"
roles/common/meta/main.yml
Show inline comments
 
@@ -3,7 +3,7 @@
 
dependencies:
 
  - role: backup_client
 
    when: enable_backup
 
    backup_patterns_name: common
 
    backup_patterns_filename: common
 
    backup_patterns:
 
      - "/root"
 
      - "/home"
roles/database/meta/main.yml
Show inline comments
 
@@ -5,6 +5,6 @@ allow_duplicates: yes
 
dependencies:
 
  - role: backup_client
 
    when: enable_backup
 
    backup_patterns_name: "database_{{ db_name }}"
 
    backup_patterns_filename: "database_{{ db_name }}"
 
    backup_patterns:
 
      - "/srv/backup/mariadb/{{ db_name }}.sql"
roles/ldap_server/meta/main.yml
Show inline comments
 
@@ -4,6 +4,6 @@ dependencies:
 
  - ldap_client
 
  - role: backup_client
 
    when: enable_backup
 
    backup_patterns_name: "ldap_server"
 
    backup_patterns_filename: "ldap_server"
 
    backup_patterns:
 
      - "/srv/backup/slapd.bak"
roles/mail_server/meta/main.yml
Show inline comments
 
@@ -3,6 +3,6 @@
 
dependencies:
 
  - role: backup_client
 
    when: enable_backup
 
    backup_patterns_name: "mail_server"
 
    backup_patterns_filename: "mail_server"
 
    backup_patterns:
 
      - "/var/{{ mail_user }}"
roles/xmpp_server/meta/main.yml
Show inline comments
 
@@ -3,6 +3,6 @@
 
dependencies:
 
  - role: backup_client
 
    when: enable_backup
 
    backup_patterns_name: "xmpp_server"
 
    backup_patterns_filename: "xmpp_server"
 
    backup_patterns:
 
      - "/var/lib/prosody"
0 comments (0 inline, 0 general)