lafranceinsoumise / ansible-backup Goto Github PK
View Code? Open in Web Editor NEWAn Ansible role for backups, based on Duply. (initially forked from Stouts.backup).
License: MIT License
An Ansible role for backups, based on Duply. (initially forked from Stouts.backup).
License: MIT License
# Backup file path
- name: uploads # Required params
schedule: 0 3 * * * # At 3am every day
source: /usr/lib/project/uploads
target: s3://s3-eu-west-1.amazonaws.com/backup.bucket/{{ inventory_hostname }}/uploads
should be
# Backup file path
- name: uploads # Required params
schedule: 0 3 * * * # At 3am every day
source: /usr/lib/project/uploads
target: s3://s3-eu-west-1.amazonaws.com/backup.bucket/{{ inventory_hostname }}/uploads
When using B2 as a target I'm getting "BackendException: B2 backend requires B2 Python APIs (pip install b2)".
Can B2 dependancies be added?
Hi,
The role looks really great, thanks for publishing it. Since I am using Debian, I would like to add support for it. Would this be of interest? If so, I could work on a pull request.
Cheers!
-username "$MONGODB_USER" -password "$MONGODB_PASSWORD"
I've been trying to find out why my restore (the bash script) doesn't execute and there seems no reference to this file in the duply script and/or documentation.
I expected it to work like: duply profile_database restore dump
and it then to restore the sql?
Hi there,
I've been using Xilonz's trellis-backup-role successfully in all my (Trellis) projects, which uses this role as dependency. Backups are uploaded to a Digital Ocean Space using S3.
In my latest project, which uses a Ubuntu 22.04 droplet for the first time (instead of 20.04), I'm not able to successfully provision my droplet with the exact same setup/credentials. I already created an issue in the trellis-backup-role repo for this, but I think the issue originates in this package.
So the error I'm getting is:
"No package matching 'python-boto' is available"
Which is defined here as:
python{{ system_python_version }}-boto
This system_python_version
variable is defined here like this:
system_python_version: "{{ (ansible_distribution_release == 'focal') | ternary('3', '') }}"
So when I try to debug this {{ ansible_distribution_release }}
variable in my server.yml playbook as a pre_task
:
pre_tasks:
- debug:
var: ansible_distribution_release
- debug:
msg: "System python version: {{ (ansible_distribution_release == 'focal') | ternary('3', '') }}"
It outputs jammy:
TASK [debug] *******************************************************************
ok: [146.190.29.96] => {
"ansible_distribution_release": "jammy"
}
TASK [debug] *******************************************************************
ok: [146.190.29.96] => {
"msg": "System python version: "
}
While it should be focal in order to use python3
correct?
I used the standard Ubuntu 22.04 (LTS) x64 image in Digital Ocean.
When I ssh into my droplet both python --version
as well as python3 --version
return:
Python 3.10.12
So it's trying to install the python(2x) version of boto
while it should be the python3 version?
I tried installing python3-boto
manually by adding it to trellis like this:
apt_packages_custom:
python3-boto: "{{ apt_package_state }}"
But it still fails with the same error, is there anything else I can do to fix this?
Thanks!
Hi,
I'm a bit confused of how to use the backup_purge action. With the example in the readme file, the module creates a separate duply config without regards for the actual backup config, e.g.
- name: create media backup for {{ site.name }}
include_role:
name: lafranceinsoumise.backup
vars:
backup_max_age: 1M # keep backups for X months
backup_max_full_backups: 4 # keep X full backups
backup_full_max_age: 7D # max age till a new full backup is created
backup_profiles:
- name: "media_{{ site.name }}"
schedule: "0 2,14 * * *"
source: "{{ site.path_prefix }}"
target: "file:///backup/{{ inventory_hostname }}/{{ site.name }}/media_{{ site.name }}"
user: "{{ site.user }}"
- name: "purge_media_{{ site.name }}"
action: "backup_purge"
schedule: "0 4 * * *"
source: "{{ site.path_prefix }}"
target: "file:///backup/{{ inventory_hostname }}/{{ site.name }}/media_{{ site.name }}"
user: "{{ site.user }}"
will create a media_foo
and purge_media_foo
config files and to cron tasks:
#Ansible: media_foo
0 2,14 * * * foo_user /usr/bin/duply /etc/duply/media_foo backup >> /var/log/duply/media_foo 2>&1
#Ansible: purge_media_foo
0 4 * * * foo_user /usr/bin/duply /etc/duply/purge_media_foo backup_purge >> /var/log/duply/purge_media_foo 2>&1
Is this the expected behavior? Do I need source
& target
in the purge config?
https://github.com/lafranceinsoumise/ansible-backup tests are only run on 16.04, so this may be possible that there is a dependency conflict on 18.04. This is a case in Xilonz/trellis-backup-role#23 but I could not reproduce on a 18.04 Scaleway box when installing manually the packages with apt.
@smaboshe could you indicate your box provider ?
Have run into two issues using this playbook with the trellis-backup playbook by @guilro (which I very much appreciate you putting together, filled a need we had). Both issues concern the backup_mysql_password
parameter in the pre.j2 template. Since solving them probably involves some overlapping work, reporting them as one single issue here.
First, there is a space inserted between the -p
flag and the password variable (line 23). The result is that duply prompts for the password instead of passing it automatically, which causes database backups to fail. That should be simple enough to fix (just need to drop the extra space). I haven't rewritten the template, but I have experimented with manually removing the space on the server and this solves the problem right away, so I'm fairly confident that's the issue.
Second (and the part I'm less sure how to solve), there is an issue if the password contains any special characters (see this stack exchange answer for more documentation). Basically, the presence of a special character without the password being passed in quotes results in an "unexpected token" error. However, I'm less clear in the syntax of this playbook how we get around that, especially while also trying to eliminate the space that causes the first issue.
Need to duplicate /var/Debian.yml
to /var/CentOS.yml
UPDATE: I guess this doesn't support CentOS. Is there a good reason for that?
The variables db
, exclude_collection
are missing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.