1
0
Fork 0

Merge branch '59-double-check-ansible-tags' into 'main'

Resolve "double-check Ansible tags"

Closes #59

See merge request lydra/yunohost/ansible-yunohost!38
This commit is contained in:
Christophe Chaudier 2022-07-19 14:47:08 +00:00
commit 764d3ee68b
10 changed files with 48 additions and 37 deletions

View file

@ -34,15 +34,16 @@ Ces tags sont applicables suivant les rôles.
|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).|
|users|Tâches spécifiques aux utilisateurs de Yunohost.|
|domains|Tâches spécifiques aux domaines liés à Yunohost.|
|apps|Tâches spécifiques aux applications 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.|
|backup|Tâches liées aux sauvegardes de Yunohost.|
|pkg|Tâches d'installation de paquets.|
|linux|Tâches liées à l'OS Linux.|
|backup|Tâches liées aux sauvegardes de Yunohost en local.|
|borg|Tâches liées aux sauvegardes avec BorgBackup.|
## License

View file

@ -34,15 +34,16 @@ These tags are applicable to roles.
|tags|comment|
|----|-------|
|pkg|Tasks that install packages.|
|linux|Tasks related to Linux.|
|yunohost|Tasks specific to Yunohost itself (setup or configuration).|
|users|Tasks specific to users in Yunohost.|
|domains|Tasks specific to domains linked to Yunohost.|
|apps|Tasks specific to Yunohost apps.|
|update|Tasks related to Yunohost update settings.|
|smtp|Tasks related to Yunohost smtp relay settings.|
|backup|Tasks related to Yunohost backups.|
|pkg|Tasks that install packages.|
|linux|Tasks related to Linux OS.|
|backup|Tasks related to local Yunohost backups.|
|borg|Tasks related to backups with BorgBackup.|
## License

View file

@ -24,8 +24,7 @@
--label "{{ ynh_app.label }}" \
--args "{% for key, value in ynh_app.args.items() %}{{ key }}={{ value }}{% if not loop.last %}&{% endif %}{% endfor %}"
changed_when: False
tags:
- apps
tags: apps
# Post-installation part
- name: Create post-install template
@ -37,8 +36,7 @@
mode: "{{ (item.type == 'script') | ternary('740', '660') }}"
loop: "{{ ynh_app.post_install|default([]) }}"
when: ynh_app.post_install
tags:
- apps
tags: apps
- name: Launch post-install script
ansible.builtin.command: "{{ ynh_app_post_install.dest }}"
@ -48,8 +46,7 @@
loop_control:
loop_var: ynh_app_post_install
when: ynh_app_post_install.type == "script"
tags:
- apps
tags: apps
- name: Remove script after execution
ansible.builtin.file:
@ -59,5 +56,4 @@
loop_control:
loop_var: ynh_app_post_install
when: ynh_app_post_install.type == "script"
tags:
- apps
tags: apps

View file

@ -22,13 +22,11 @@
ansible.builtin.command: yunohost app map --output-as json
register: ynh_installed_apps_raw
changed_when: False
tags:
- apps
tags: apps
- name: Format json of apps
ansible.builtin.set_fact: ynh_installed_apps="{{ ynh_installed_apps_raw.stdout | from_json }}"
tags:
- apps
tags: apps
- name: Install yunohost apps and perform post-install
ansible.builtin.include_tasks: app.yml
@ -36,5 +34,4 @@
loop_control:
loop_var: ynh_app
when: ynh_app.label not in ynh_installed_apps.values()
tags:
- apps
tags: apps

View file

@ -21,6 +21,4 @@
- name: Install Yunohost apps
ansible.builtin.include_tasks: apps.yml
when: ynh_apps
tags:
- yunohost
- apps
tags: apps

View file

@ -23,8 +23,7 @@
path: "{{ ynh_backup.directory | default('/home/yunohost.backup/archives') }}"
state: directory
mode: '0750'
tags:
- backup
tags: backup
- name: Create backup script
ansible.builtin.template:
@ -33,8 +32,7 @@
owner: root
group: root
mode: '0740'
tags:
- backup
tags: backup
- name: Create cron task to schedule YNH backup script
ansible.builtin.cron:
@ -46,6 +44,4 @@
user: root
job: "{{ ynh_backup_dest_script }}"
cron_file: ynh_backup_cron
tags:
- backup
- cron
tags: backup

View file

@ -21,18 +21,30 @@
ansible.builtin.command: ansible-galaxy install m3nu.ansible_role_borgbackup,v0.9.0 -p ~/.ansible/roles
delegate_to: localhost
become: False
tags:
- backup
- borg
- name: run BorgBackup role
ansible.builtin.import_role:
name: m3nu.ansible_role_borgbackup
tags:
- backup
- borg
- name: Create backup folder for BorgBackup repository
ansible.builtin.file:
path: "{{ borg_repository }}"
state: directory
mode: '0750'
tags:
- backup
- borg
- name: Configure host for Borg Remote repository
tags:
- backup
- borg
block:
- name: deploy ssh public key for BorgBackup
ansible.builtin.copy:
@ -58,6 +70,9 @@
line: "{{ ynh_ssh_borg_command }}"
state: present
when: ynh_ssh_borg_command is defined
tags:
- backup
- borg
- name: change archive name in "/etc/borgmatic/{{ borgmatic_config_name }}"
@ -66,6 +81,9 @@
regexp: "archive_name_format:"
line: " archive_name_format: {{ borg_archive_name_format }}"
state: present
tags:
- backup
- borg
- name: Create borg launch script in /usr/local/bin
ansible.builtin.copy:
@ -77,6 +95,12 @@
owner: root
group: root
mode: "0755"
tags:
- backup
- borg
- name: Initialize a new Borg repository
ansible.builtin.command: "{{ borg_init_command }}"
tags:
- backup
- borg

View file

@ -21,12 +21,11 @@
- name: Enable Yunohost apps backup
ansible.builtin.include_tasks: backup.yml
when: ynh_backup.scheduled
tags:
- backup
tags: backup
- name: Use Borg Backup with YunoHost
ansible.builtin.include_tasks: borgbackup.yml
when: ynh_borg_backup_scheduled
tags:
- backup
- borg
- backup
- borg

View file

@ -28,7 +28,6 @@
tags:
- yunohost
- update
- cron
- name: Creates cron task under /etc/cron.d to auto-update Yunohost
ansible.builtin.cron:
@ -41,4 +40,3 @@
tags:
- yunohost
- update
- cron

View file

@ -53,6 +53,7 @@
- "{{ ynh_data_dirs }}"
tags:
- linux
- yunohost
when: ynh_data_dirs_enabled
- name: Create symbolic links for Yunohost subdirs
@ -65,6 +66,7 @@
- "{{ ynh_data_dirs }}"
tags:
- linux
- yunohost
when: ynh_data_dirs_enabled
- name: Test if Yunohost is already installed
@ -97,7 +99,6 @@
when: not ynh_file_install.stat.exists
tags:
- yunohost
- domains
- name: Create extra domains
ansible.builtin.include_tasks: domains.yml