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 025dce2d authored by Arthur BOUDREAULT's avatar Arthur BOUDREAULT
Browse files

refactor: task is now in main.yml + updates readme

parent 088ec038
No related branches found
No related tags found
1 merge request!18✅Resolve "How to auto update apps"
Pipeline #3321 passed with warnings
...@@ -132,7 +132,10 @@ Cette tâche utilisant le module template, vous pouvez tout à fait utiliser vos ...@@ -132,7 +132,10 @@ Cette tâche utilisant le module template, vous pouvez tout à fait utiliser vos
Pour `owner` et `group`, par défaut le fichier va prendre comme utilisateur propriétaire le nom de l'application et comme groupe propriétaire www-data (groupe NGINX). Vous pouvez les changer en précisant des valeurs différentes. Pour `owner` et `group`, par défaut le fichier va prendre comme utilisateur propriétaire le nom de l'application et comme groupe propriétaire www-data (groupe NGINX). Vous pouvez les changer en précisant des valeurs différentes.
#### Concernant les mises à jour : #### Concernant les mises à jour :
Une tâche cron a été mise en place pour automatiser la vérification des mises à jour système et applications tous les jours à 1 heure du matin. Si des mises à jour sont disponibles, elles sont faites automatiquement. En cas de problème suite à la mise à jour d'une application, vous avez la possibilité de revenir à la version précédente car Yunohost fait toujours une sauvegarde automatique d'une application lorsqu'elle est mise à jour. Une tâche cron peut être mise en place pour automatiser la vérification des mises à jour système et applications suivant la périodicité de votre choix.
- `ynh_autoupdate.scheduled` : Activez la tâche cron en mettant la valeur à "true".
- `ynh_autoupdate.special_time`: Cette variable est obligatoire. Elle permet de préciser quand vous souhaitez que cette tâche soit exécutée. Pour en savoir plus sur les special times, cliquez [ici] (https://docs.ansible.com/ansible/latest/collections/ansible/builtin/cron_module.html)
Si des mises à jour sont disponibles, elles sont faites automatiquement. En cas de problème suite à la mise à jour d'une application, vous pouvez lire les logs qui sont disponibles ici `/var/log/yunohost/categories/operation`. Vous avez aussi la possibilité de revenir à la version précédente car Yunohost fait toujours une sauvegarde automatique d'une application lorsqu'elle est mise à jour.
Pour en savoir plus sur le fonctionnement des mises à jour dans Yunohost vous pouvez vous rendre [ici](https://yunohost.org/fr/update). Le changelog des versions de Yunohost est aussi disponible [ici](https://forum.yunohost.org/tag/ynh_release). Pour en savoir plus sur le fonctionnement des mises à jour dans Yunohost vous pouvez vous rendre [ici](https://yunohost.org/fr/update). Le changelog des versions de Yunohost est aussi disponible [ici](https://forum.yunohost.org/tag/ynh_release).
......
...@@ -132,7 +132,11 @@ Because this task uses the template module, you can use your own variables and c ...@@ -132,7 +132,11 @@ Because this task uses the template module, you can use your own variables and c
For `owner` and `group`, by default the file will take as owner the name of the application and as owner www-data(NGINX group). You can change them by specifying different values. For `owner` and `group`, by default the file will take as owner the name of the application and as owner www-data(NGINX group). You can change them by specifying different values.
#### About the updates: #### About the updates:
A cron job has been set up to automate the check for system and application updates every day at 1am. If updates are available, they are done automatically. In case of problems following an application update, you have the possibility to rollback to the previous version because Yunohost always makes an automatic backup of an application when it is updated. A cron job can been set up to automate the check for system and application updates on a schedule of your choice.
- `ynh_autoupdate.scheduled` : Enable the cron job by setting the value to "true".
- `ynh_autoupdate.special_time`: This variable is mandatory. It allows you to specify when you want this task to be executed. To learn more about special times, click [here] (https://docs.ansible.com/ansible/latest/collections/ansible/builtin/cron_module.html)
If available, updates are done automatically. In case of problems following an application update, you can read logs located in `/var/log/yunohost/categories/operation` . You also have the possibility to rollback to the previous version since Yunohost always makes an automatic backup of an application when it is updated.
To learn more about how updates work in Yunohost you can go [here](https://yunohost.org/fr/update). The changelog of Yunohost versions is also available [here](https://forum.yunohost.org/tag/ynh_release). To learn more about how updates work in Yunohost you can go [here](https://yunohost.org/fr/update). The changelog of Yunohost versions is also available [here](https://forum.yunohost.org/tag/ynh_release).
......
...@@ -63,3 +63,7 @@ ynh_apps: null ...@@ -63,3 +63,7 @@ ynh_apps: null
# owner: ttrss # Only provide if different from app name # owner: ttrss # Only provide if different from app name
# group: ttrss # Only provide if different from www-data # group: ttrss # Only provide if different from www-data
# Autoupdate Yunohost and its apps
ynh_autoupdate:
scheduled: "false"
special_time: "daily" #Choices are [annually,daily,hourly,monthly,reboot,weekly,yearly]
...@@ -33,13 +33,3 @@ ...@@ -33,13 +33,3 @@
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()
- name: Creates a cron file under /etc/cron.d to auto-update Yunohost everyday
ansible.builtin.cron:
name: "auto-update Yunohost everyday.
Logs can be found in /var/log/yunohost/categories/operation"
special_time: "daily"
user: root
job: "yunohost tools update && \
yunohost tools upgrade system && \
yunohost tools upgrade apps"
cron_file: ynh_autoupdate
...@@ -72,3 +72,15 @@ ...@@ -72,3 +72,15 @@
- 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
- name: Creates a cron task under /etc/cron.d to auto-update Yunohost
ansible.builtin.cron:
name: "auto-update Yunohost.
Logs can be found in /var/log/yunohost/categories/operation"
special_time: "{{ ynh_autoupdate.special_time }}"
user: root
job: "yunohost tools update && \
yunohost tools upgrade system && \
yunohost tools upgrade apps"
cron_file: ynh_autoupdate_cron
when: ynh_autoupdate.scheduled == "true"
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