This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Set up backup user to be used by Ansible | |
hosts: all | |
remote_user: <an existing user> | |
roles: | |
- yaegashi.blockinfile | |
tasks: | |
- name: Generate a unique key for this host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Incrementally back up host using BackupPC | |
hosts: all | |
remote_user: backup | |
tasks: | |
- name: Back up the host | |
local_action: command /usr/share/backuppc/bin/BackupPC_dump -i {{ inventory_hostname }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
#first, dump all MySQL databases and move them to a folder that gets backed up by BackupPC | |
- hosts: mysql | |
tasks: | |
- name: Create /backup/sql recursively | |
file: path=/backup/sql state=directory owner=backup group=backup mode=0766 recurse=yes | |
- name: Dump all MySQL databases, where applicable | |
shell: "/usr/bin/mysqldump --all-databases > /backup/sql/mysql.sql" |
NewerOlder