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

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • lydra/yunohost/ansible-yunohost
1 result
Show changes
Commits on Source (4)
...@@ -34,15 +34,16 @@ Ces tags sont applicables suivant les rôles. ...@@ -34,15 +34,16 @@ Ces tags sont applicables suivant les rôles.
|tags|commentaires| |tags|commentaires|
|----|-------| |----|-------|
|pkg|Tâches d'installation de paquets.|
|linux|Tâches liées à l'OS Linux.|
|yunohost|Tâches spécifiques à Yunohost lui-même (installation ou configuration).| |yunohost|Tâches spécifiques à Yunohost lui-même (installation ou configuration).|
|users|Tâches spécifiques aux utilisateurs de Yunohost.| |users|Tâches spécifiques aux utilisateurs de Yunohost.|
|domains|Tâches spécifiques aux domaines liés à Yunohost.| |domains|Tâches spécifiques aux domaines liés à Yunohost.|
|apps|Tâches spécifiques aux applications de Yunohost.| |apps|Tâches spécifiques aux applications de Yunohost.|
|update|Tâches liées aux paramètres de mise à jour de Yunohost.| |update|Tâches liées aux paramètres de mise à jour de Yunohost.|
|smtp|Tâches liées aux paramètres de relais smtp de Yunohost.| |smtp|Tâches liées aux paramètres de relais smtp de Yunohost.|
|backup|Tâches liées aux sauvegardes de Yunohost.| |backup|Tâches liées aux sauvegardes de Yunohost en local.|
|pkg|Tâches d'installation de paquets.| |borg|Tâches liées aux sauvegardes avec BorgBackup.|
|linux|Tâches liées à l'OS Linux.|
## License ## License
......
...@@ -34,15 +34,16 @@ These tags are applicable to roles. ...@@ -34,15 +34,16 @@ These tags are applicable to roles.
|tags|comment| |tags|comment|
|----|-------| |----|-------|
|pkg|Tasks that install packages.|
|linux|Tasks related to Linux.|
|yunohost|Tasks specific to Yunohost itself (setup or configuration).| |yunohost|Tasks specific to Yunohost itself (setup or configuration).|
|users|Tasks specific to users in Yunohost.| |users|Tasks specific to users in Yunohost.|
|domains|Tasks specific to domains linked to Yunohost.| |domains|Tasks specific to domains linked to Yunohost.|
|apps|Tasks specific to Yunohost apps.| |apps|Tasks specific to Yunohost apps.|
|update|Tasks related to Yunohost update settings.| |update|Tasks related to Yunohost update settings.|
|smtp|Tasks related to Yunohost smtp relay settings.| |smtp|Tasks related to Yunohost smtp relay settings.|
|backup|Tasks related to Yunohost backups.| |backup|Tasks related to local Yunohost backups.|
|pkg|Tasks that install packages.| |borg|Tasks related to backups with BorgBackup.|
|linux|Tasks related to Linux OS.|
## License ## License
......
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
--label "{{ ynh_app.label }}" \ --label "{{ ynh_app.label }}" \
--args "{% for key, value in ynh_app.args.items() %}{{ key }}={{ value }}{% if not loop.last %}&{% endif %}{% endfor %}" --args "{% for key, value in ynh_app.args.items() %}{{ key }}={{ value }}{% if not loop.last %}&{% endif %}{% endfor %}"
changed_when: False changed_when: False
tags: tags: apps
- apps
# Post-installation part # Post-installation part
- name: Create post-install template - name: Create post-install template
...@@ -37,8 +36,7 @@ ...@@ -37,8 +36,7 @@
mode: "{{ (item.type == 'script') | ternary('740', '660') }}" mode: "{{ (item.type == 'script') | ternary('740', '660') }}"
loop: "{{ ynh_app.post_install|default([]) }}" loop: "{{ ynh_app.post_install|default([]) }}"
when: ynh_app.post_install when: ynh_app.post_install
tags: tags: apps
- apps
- name: Launch post-install script - name: Launch post-install script
ansible.builtin.command: "{{ ynh_app_post_install.dest }}" ansible.builtin.command: "{{ ynh_app_post_install.dest }}"
...@@ -48,8 +46,7 @@ ...@@ -48,8 +46,7 @@
loop_control: loop_control:
loop_var: ynh_app_post_install loop_var: ynh_app_post_install
when: ynh_app_post_install.type == "script" when: ynh_app_post_install.type == "script"
tags: tags: apps
- apps
- name: Remove script after execution - name: Remove script after execution
ansible.builtin.file: ansible.builtin.file:
...@@ -59,5 +56,4 @@ ...@@ -59,5 +56,4 @@
loop_control: loop_control:
loop_var: ynh_app_post_install loop_var: ynh_app_post_install
when: ynh_app_post_install.type == "script" when: ynh_app_post_install.type == "script"
tags: tags: apps
- apps
...@@ -22,13 +22,11 @@ ...@@ -22,13 +22,11 @@
ansible.builtin.command: yunohost app map --output-as json ansible.builtin.command: yunohost app map --output-as json
register: ynh_installed_apps_raw register: ynh_installed_apps_raw
changed_when: False changed_when: False
tags: tags: apps
- apps
- name: Format json of apps - name: Format json of apps
ansible.builtin.set_fact: ynh_installed_apps="{{ ynh_installed_apps_raw.stdout | from_json }}" ansible.builtin.set_fact: ynh_installed_apps="{{ ynh_installed_apps_raw.stdout | from_json }}"
tags: tags: apps
- apps
- name: Install yunohost apps and perform post-install - name: Install yunohost apps and perform post-install
ansible.builtin.include_tasks: app.yml ansible.builtin.include_tasks: app.yml
...@@ -36,5 +34,4 @@ ...@@ -36,5 +34,4 @@
loop_control: loop_control:
loop_var: ynh_app loop_var: ynh_app
when: ynh_app.label not in ynh_installed_apps.values() when: ynh_app.label not in ynh_installed_apps.values()
tags: tags: apps
- apps
...@@ -21,6 +21,4 @@ ...@@ -21,6 +21,4 @@
- name: Install Yunohost apps - name: Install Yunohost apps
ansible.builtin.include_tasks: apps.yml ansible.builtin.include_tasks: apps.yml
when: ynh_apps when: ynh_apps
tags: tags: apps
- yunohost
- apps
...@@ -68,7 +68,7 @@ ynh_ssh_borg_command: "ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i { ...@@ -68,7 +68,7 @@ ynh_ssh_borg_command: "ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i {
- `borgmatic_config_name` : **Optionnel**, nom du fichier de configuration Borgmatic. - `borgmatic_config_name` : **Optionnel**, nom du fichier de configuration Borgmatic.
- `borgmatic_cron_name` : **Optionnel**, nom du fichier de tâche cron. - `borgmatic_cron_name` : **Optionnel**, nom du fichier de tâche cron.
- `borg_retention_policy.keep_[hourly|daily|weekly|monthly]` : Permet de régler finement le nombre d'archives récentes que le dépôt doit garder. - `borg_retention_policy.keep_[hourly|daily|weekly|monthly]` : Permet de régler finement le nombre d'archives récentes que le dépôt doit garder.
- `borg_ssh_keys_src` : Chemin où se trouve le couple clé publique / privée SSH sur l'hôte Ansible. - `borg_ssh_keys_src` : Chemin où se trouve le couple clé publique / privée SSH sur l'hôte Ansible. Pensez à utiliser [Ansible Vault](https://docs.ansible.com/ansible/latest/user_guide/vault.html) pour protéger vos clés SSH.
- `borg_ssh_keys_dest` : Chemin où va être copié la paire de clés SSH sur le serveur YunoHost. - `borg_ssh_keys_dest` : Chemin où va être copié la paire de clés SSH sur le serveur YunoHost.
- `ynh_ssh_borg_command`: **Optionnel**, commande SSH personnalisée lors de l'utilisation de Borg sur un dépôt distant. - `ynh_ssh_borg_command`: **Optionnel**, commande SSH personnalisée lors de l'utilisation de Borg sur un dépôt distant.
......
...@@ -61,13 +61,13 @@ borg_ssh_keys_dest: "/home/debian/.ssh/ynh_ed25519" ...@@ -61,13 +61,13 @@ borg_ssh_keys_dest: "/home/debian/.ssh/ynh_ed25519"
- `ynh_borg_backup_scheduled`: Enable / disable the backup feature with BorgBackup. - `ynh_borg_backup_scheduled`: Enable / disable the backup feature with BorgBackup.
- `ynh_borg_backup_remote_repo`: Enable / disable the backup functionality on a BorgBackup remote repository (tasks related to SSH keys setup). If you enable this feature, then you will need to use `borg_ssh_keys_src` and `borg_ssh_keys_dest` variables. - `ynh_borg_backup_remote_repo`: Enable / disable the backup functionality on a BorgBackup remote repository (tasks related to SSH keys setup). If you enable this feature, then you will need to use `borg_ssh_keys_src` and `borg_ssh_keys_dest` variables.
- `borg_source_directories`: List of source folders to backup. By default, this is the folder containing all YunoHost data (configuration, applications). - `borg_source_directories`: List of source folders to back up. By default, this is the folder containing all YunoHost data (configuration, applications).
- `borg_repository`: Full path to the Borg repository. Possibility to give a list of repositories to save data in several places. - `borg_repository`: Full path to the Borg repository. Possibility to give a list of repositories to save data in several places.
- `borg_encryption_passphrase` : **Mandatory**, password to use for the Borg repository encryption key. - `borg_encryption_passphrase` : **Mandatory**, password to use for the Borg repository encryption key.
- `borgmatic_config_name`: **Optional**, name of the Borgmatic configuration file. - `borgmatic_config_name`: **Optional**, name of the Borgmatic configuration file.
- `borgmatic_cron_name`: **Optional**, name of the cron task file. - `borgmatic_cron_name`: **Optional**, name of the cron task file.
- `borg_retention_policy.keep_[hourly|daily|weekly|monthly]`: Allows you to fine-tune the number of recent archives the repository should keep. - `borg_retention_policy.keep_[hourly|daily|weekly|monthly]`: Allows you to fine-tune the number of recent archives the repository should keep.
- `borg_ssh_keys_src`: Path to the SSH public/private key pair on the Ansible host. - `borg_ssh_keys_src`: Path to the SSH public/private key pair on the Ansible host. Consider using [Ansible Vault](https://docs.ansible.com/ansible/latest/user_guide/vault.html) to protect your SSH keys.
- `borg_ssh_keys_dest`: Path where the SSH key pair will be copied to the YunoHost server. - `borg_ssh_keys_dest`: Path where the SSH key pair will be copied to the YunoHost server.
- `ynh_ssh_borg_command`: **Optional**, custom SSH command run when using Borg on a remote repository. - `ynh_ssh_borg_command`: **Optional**, custom SSH command run when using Borg on a remote repository.
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
path: "{{ ynh_backup.directory | default('/home/yunohost.backup/archives') }}" path: "{{ ynh_backup.directory | default('/home/yunohost.backup/archives') }}"
state: directory state: directory
mode: '0750' mode: '0750'
tags: tags: backup
- backup
- name: Create backup script - name: Create backup script
ansible.builtin.template: ansible.builtin.template:
...@@ -33,8 +32,7 @@ ...@@ -33,8 +32,7 @@
owner: root owner: root
group: root group: root
mode: '0740' mode: '0740'
tags: tags: backup
- backup
- name: Create cron task to schedule YNH backup script - name: Create cron task to schedule YNH backup script
ansible.builtin.cron: ansible.builtin.cron:
...@@ -46,6 +44,4 @@ ...@@ -46,6 +44,4 @@
user: root user: root
job: "{{ ynh_backup_dest_script }}" job: "{{ ynh_backup_dest_script }}"
cron_file: ynh_backup_cron cron_file: ynh_backup_cron
tags: tags: backup
- backup
- cron
...@@ -21,18 +21,36 @@ ...@@ -21,18 +21,36 @@
ansible.builtin.command: ansible-galaxy install m3nu.ansible_role_borgbackup,v0.9.0 -p ~/.ansible/roles ansible.builtin.command: ansible-galaxy install m3nu.ansible_role_borgbackup,v0.9.0 -p ~/.ansible/roles
delegate_to: localhost delegate_to: localhost
become: False become: False
tags:
- backup
- borg
- name: Gather facts for BorgBackup role
ansible.builtin.setup:
tags:
- borg
- backup
- name: run BorgBackup role - name: run BorgBackup role
ansible.builtin.import_role: ansible.builtin.import_role:
name: m3nu.ansible_role_borgbackup name: m3nu.ansible_role_borgbackup
tags:
- backup
- borg
- name: Create backup folder for BorgBackup repository - name: Create backup folder for BorgBackup repository
ansible.builtin.file: ansible.builtin.file:
path: "{{ borg_repository }}" path: "{{ borg_repository }}"
state: directory state: directory
mode: '0750' mode: '0750'
tags:
- backup
- borg
- name: Configure host for Borg Remote repository - name: Configure host for Borg Remote repository
tags:
- backup
- borg
block: block:
- name: deploy ssh public key for BorgBackup - name: deploy ssh public key for BorgBackup
ansible.builtin.copy: ansible.builtin.copy:
...@@ -44,7 +62,7 @@ ...@@ -44,7 +62,7 @@
- name: deploy ssh private key for BorgBackup - name: deploy ssh private key for BorgBackup
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ borg_ssh_keys_src }}" src: "{{ borg_ssh_keys_src }}.vault"
dest: "{{ borg_ssh_keys_dest }}" dest: "{{ borg_ssh_keys_dest }}"
owner: "root" owner: "root"
group: "root" group: "root"
...@@ -58,6 +76,9 @@ ...@@ -58,6 +76,9 @@
line: "{{ ynh_ssh_borg_command }}" line: "{{ ynh_ssh_borg_command }}"
state: present state: present
when: ynh_ssh_borg_command is defined when: ynh_ssh_borg_command is defined
tags:
- backup
- borg
- name: change archive name in "/etc/borgmatic/{{ borgmatic_config_name }}" - name: change archive name in "/etc/borgmatic/{{ borgmatic_config_name }}"
...@@ -66,6 +87,9 @@ ...@@ -66,6 +87,9 @@
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
tags:
- backup
- borg
- name: Create borg launch script in /usr/local/bin - name: Create borg launch script in /usr/local/bin
ansible.builtin.copy: ansible.builtin.copy:
...@@ -77,6 +101,12 @@ ...@@ -77,6 +101,12 @@
owner: root owner: root
group: root group: root
mode: "0755" mode: "0755"
tags:
- backup
- borg
- name: Initialize a new Borg repository - name: Initialize a new Borg repository
ansible.builtin.command: "{{ borg_init_command }}" ansible.builtin.command: "{{ borg_init_command }}"
tags:
- backup
- borg
...@@ -21,12 +21,11 @@ ...@@ -21,12 +21,11 @@
- name: Enable Yunohost apps backup - name: Enable Yunohost apps backup
ansible.builtin.include_tasks: backup.yml ansible.builtin.include_tasks: backup.yml
when: ynh_backup.scheduled when: ynh_backup.scheduled
tags: tags: backup
- backup
- name: Use Borg Backup with YunoHost - name: Use Borg Backup with YunoHost
ansible.builtin.include_tasks: borgbackup.yml ansible.builtin.include_tasks: borgbackup.yml
when: ynh_borg_backup_scheduled when: ynh_borg_backup_scheduled
tags: tags:
- backup - backup
- borg - borg
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
tags: tags:
- yunohost - yunohost
- update - update
- cron
- name: Creates cron task under /etc/cron.d to auto-update Yunohost - name: Creates cron task under /etc/cron.d to auto-update Yunohost
ansible.builtin.cron: ansible.builtin.cron:
...@@ -41,4 +40,3 @@ ...@@ -41,4 +40,3 @@
tags: tags:
- yunohost - yunohost
- update - update
- cron
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
- "{{ ynh_data_dirs }}" - "{{ ynh_data_dirs }}"
tags: tags:
- linux - linux
- yunohost
when: ynh_data_dirs_enabled when: ynh_data_dirs_enabled
- name: Create symbolic links for Yunohost subdirs - name: Create symbolic links for Yunohost subdirs
...@@ -65,6 +66,7 @@ ...@@ -65,6 +66,7 @@
- "{{ ynh_data_dirs }}" - "{{ ynh_data_dirs }}"
tags: tags:
- linux - linux
- yunohost
when: ynh_data_dirs_enabled when: ynh_data_dirs_enabled
- name: Test if Yunohost is already installed - name: Test if Yunohost is already installed
...@@ -97,7 +99,6 @@ ...@@ -97,7 +99,6 @@
when: not ynh_file_install.stat.exists when: not ynh_file_install.stat.exists
tags: tags:
- yunohost - yunohost
- domains
- name: Create extra domains - name: Create extra domains
ansible.builtin.include_tasks: domains.yml ansible.builtin.include_tasks: domains.yml
......