Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 793fd7de authored by Arthur BOUDREAULT's avatar Arthur BOUDREAULT
Browse files

Test 2

parent 5b1190c6
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !32. Comments created here will be created in the context of that merge request.
...@@ -29,14 +29,17 @@ ynh_backup: ...@@ -29,14 +29,17 @@ ynh_backup:
# system: True # system: True
# apps: True # apps: True
ynh_borg_backup: ynh_borg_backup_scheduled: False
scheduled: False ynh_borg_backup_remote_repo: False
# borg_source_directories: "{{ borg_ynh_src_dir }}" borg_source_directories:
# borg_repository: "{{ borg_ynh_remote_repo }}" - "/data/yunohost"
# borgmatic_config_name: "{{ borgmatic_conf_name }}" borg_repository: "/data/backup/live"
# borg_encryption_passphrase: "{{ borg_remote_repo_encryption_passphrase }}" borg_init_command: "borgmatic init -c /etc/borgmatic/{{ borgmatic_config_name }} -e repokey --syslog-verbosity 1"
# borg_retention_policy: borgmatic_config_name: "borgmatic_ynh_config"
# keep_daily: "{{ borg_days_to_keep }}" borg_encryption_passphrase: "PLEASECHANGEME"
# keep_weekly: "{{ borg_weeks_to_keep }}" borg_retention_policy:
# keep_monthly: "{{ borg_months_to_keep }}" keep_daily: "4"
# borgmatic_cron_name: "{{ borgmatic_ynh_cron_name }}" keep_weekly: "0"
keep_monthly: "0"
borgmatic_cron_name: "borgmatic_ynh_cron"
borg_archive_name_format: "'{hostname}-yunohost-live-data-{now:%Y-%m-%d-%H%M%S}'"
...@@ -18,13 +18,16 @@ ...@@ -18,13 +18,16 @@
# # # #
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
- name: Download BorgBackup role on localhost - name: Download BorgBackup role on localhost
local_action: ansible.builtin.command ansible-galaxy install -r requirements.yml local_action:
module: ansible.builtin.command
cmd: ansible-galaxy install -r requirements.yml
become: False
- name: import BorgBackup role - name: run BorgBackup role
ansible.builtin.import_role: ansible.builtin.import_role:
name: m3nu.ansible_role_borgbackup name: m3nu.ansible_role_borgbackup
- name: Configure host for Borg Remote repository - name: Configure host for Borg Remote repository #in README, need to tell that ssh pub/priv keys are necessary
block: block:
- name: deploy ssh public key for BorgBackup - name: deploy ssh public key for BorgBackup
ansible.builtin.copy: ansible.builtin.copy:
...@@ -42,30 +45,20 @@ ...@@ -42,30 +45,20 @@
group: "{{ admin_user }}" group: "{{ admin_user }}"
mode: 0600 mode: 0600
- name: change ssh command in "/etc/borgmatic/{{ borgmatic_config_name }}" - name: change SSH command in "/etc/borgmatic/{{ borgmatic_config_name }}"
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: "/etc/borgmatic/{{ borgmatic_config_name }}" path: "/etc/borgmatic/{{ borgmatic_config_name }}"
regexp: "# ssh_command: ssh -i ~/.ssh/id_ed25519" regexp: "# ssh_command: ssh -i ~/.ssh/id_ed25519"
line: " ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i {{ borg_ssh_keys_dest }}" line: " ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i {{ borg_ssh_keys_dest }}"
state: present state: present
when: ynh_borg_backup_remote_repo
- name: change archive name in "/etc/borgmatic/{{ borgmatic_config_name }}" - name: change archive name in "/etc/borgmatic/{{ borgmatic_config_name }}"
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: "/etc/borgmatic/{{ borgmatic_config_name }}" path: "/etc/borgmatic/{{ borgmatic_config_name }}"
regexp: "archive_name_format:" regexp: "archive_name_format:"
line: " archive_name_format: {{ borg_archive_name_format }}" line: " archive_name_format: {{ borg_archive_name_format }}"
state: present state: present
- name: Create borg command in /usr/local/bin
ansible.builtin.copy:
content: |
#!/bin/bash
. /opt/borgmatic/bin/activate
borg "$@"
dest: /usr/local/bin/borg
owner: root
group: root
mode: "0755"
- name: Initialize a new Borg remote repository - name: Initialize a new Borg remote repository
ansible.builtin.command: "{{ borg_init_command }}" ansible.builtin.command: "{{ borg_init_command }}"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
- name: Use Borg Backup with YunoHost - name: Use Borg Backup with YunoHost
ansible.builtin.include_tasks: borg.yml ansible.builtin.include_tasks: borg.yml
when: ynh_borg_backup.scheduled when: ynh_borg_backup_scheduled
tags: tags:
- backup - backup
- borg - borg
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment