refactor: update roles tags + drop cron tag
docs: new borg tag
This commit is contained in:
parent
732c4c5b5c
commit
cc3d2b97e0
10 changed files with 48 additions and 37 deletions
|
@ -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.
|
||||||
|
|
||||||
|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 @@
|
||||||
--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 @@
|
||||||
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 @@
|
||||||
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 @@
|
||||||
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 @@
|
||||||
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 @@
|
||||||
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 @@
|
||||||
- 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
|
|
||||||
|
|
|
@ -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 @@
|
||||||
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 @@
|
||||||
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,30 @@
|
||||||
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: 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:
|
||||||
|
@ -58,6 +70,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 +81,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 +95,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,8 +21,7 @@
|
||||||
- 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
|
||||||
|
|
|
@ -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 @@
|
||||||
tags:
|
tags:
|
||||||
- yunohost
|
- yunohost
|
||||||
- update
|
- update
|
||||||
- cron
|
|
||||||
|
|
|
@ -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 @@
|
||||||
- "{{ 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 @@
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue