Newer
Older
# Ansible Role: YunoHost
[🇫🇷 French version](README-FR.md)
Deploy [YunoHost](https://yunohost.org/#/) with Ansible!
YunoHost needs to be installed on your server.
## Role Variables
The default variables are available in `default/main.yml` however it is possible to override them according to your needs.
We have integrated two different backup systems to this YunoHost role:
- YunoHost native local backups: YunoHost provides its own native backup system. It is able to back up YunoHost configuration, mails (if YunoHost is used as a mail server) and applications installed on YunoHost. It is possible to create and restore backups from the web administration interface as well as from the command line in SSH (`yunohost backup`). Backups are available locally, and we have automated the triggering of these backups. More info [here](https://yunohost.org/fr/backup).
- Backups with Borg Backup: We have also integrated the Ansible role `m3nu.ansible_role_borgbackup` which allows to automate the installation and configuration process of Borg Backup on a YunoHost server. Borg backups are accessible on a local or a remote Borg repository. More info [here](https://github.com/borgbase/ansible-role-borgbackup).
### Backups management
```yml
ynh_backup:
scheduled: True
directory: "/data/backup"
scheduled_hour: "*"
scheduled_minute: "*/30"
scheduled_weekday: "*"
scheduled_month: "*"
system: True
apps: True
src_script: "templates/ynh_backup.sh.j2"
dest_script: "/usr/bin"
```
The _backup_ task will allow to back up YunoHost applications and their data by setting up a cron job. This backup uses the one provided by [YunoHost](https://yunohost.org/fr/backup) and it is local to the server.
- `ynh_backup.scheduled`: to enable the YunoHost applications backup feature, set the value to `True`.
- `ynh_backup.directory`: the default backup folder is `/home/yunohost.backup/archives` however you can choose to save the backups in another folder with this variable. In this case, in order to be able to restore the backups from the web interface, YunoHost automatically creates a symbolic link from the created archive to its default folder.
- `ynh_backup.scheduled_[hour|minute|weekday|month]`: modifies the scheduling of the cron task. By default it will run every day of the year at 1am. For more information about cron time settings, this tool can be useful: <https://crontab.guru/>.
- `ynh_backup.system`: is mandatory. Enables automatic backup of the YunoHost system by setting the value to `True`.
- `ynh_backup.apps`: is mandatory. Enables automatic backup of YunoHost applications by setting the value to `True`.
## Dependencies
**Optional**: The `m3nu.ansible_role_borgbackup` role must be installed on the machine running Ansible for Borg-related tasks to work. A `requirements.yml` file is in the root of the role and will download the role (by default to `~/.ansible/roles`).
## Example Playbook
```yml
---
- name: Configure YunoHost backups
hosts: all
become: True
```
## License
[](https://choosealicense.com/licenses/gpl-3.0/)
**ansible-yunohost** is maintained by [Lydra](https://lydra.fr/) and released under the GPL3 license.