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

refactor: restructuring role into collection #2

parent 49d31c08
No related branches found
No related tags found
No related merge requests found
Pipeline #3690 passed with warnings
This commit is part of merge request !24. Comments created here will be created in the context of that merge request.
Showing
with 2688 additions and 0 deletions
.gitlab-ci.yml 0 → 100644
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# #
# this program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# this program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
#-----------------------------------------------------------------------------#
# -*- coding: utf-8 -*-
# Doc: https://docs.gitlab.com/ce/ci/yaml/#include
include:
- project: 'froggit/ci/gci-tpl'
ref: 0.0.1
file:
- '/templates/stages.yml'
- '/templates/job/ansible/lint.yml'
# No playbook in this repo
ansible-syntax-check:
rules:
- when: never
LICENSE 0 → 100644
+ 674
0
View file @ 4ca61780
This diff is collapsed.
README.md 0 → 100644
# Ansible Collection - lydra.yunohost
This collection aims at installing, configuring and backing up Yunohost.
As this is an independent collection, it can be released on its own release cadence.
## Collection contents
### Roles
- `lydra.yunohost.ynh_setup` : This role prepares servers with Debian-Buster-based to run Yunohost.
- `lydra.yunohost.ynh_config` : This role manages configuring and starting various Yunohost services.
- `lydra.yunohost.ynh_backup` : This role manages configuring of backups.
## License
[![ansible-yunohost Copyright 2021 Lydra](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](https://choosealicense.com/licenses/gpl-3.0/)
**ansible-yunohost** is maintained by [Lydra](https://lydra.fr/) and released under the GPL3 license.
galaxy.yml 0 → 100644
### REQUIRED
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
# underscores or numbers and cannot contain consecutive underscores
namespace: lydra
# The name of the collection. Has the same character restrictions as 'namespace'
name: yunohost
# The version of the collection. Must be compatible with semantic versioning
version: 1.0.0
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- Lydra (<suppport@lydra.fr>)
### OPTIONAL but strongly recommended
# A short summary description of the collection
description: Yunohost related Roles and Modules
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
license:
- GPL-3.0-or-later
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
# mutually exclusive with 'license'
license_file: 'LICENSE'
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags:
- yunohost
- cloud
- web
# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
dependencies: {}
# The URL of the originating SCM repository
repository: http://example.com/repository
# The URL to any online docs
documentation: http://docs.example.com
# The URL to the homepage of the collection/project
homepage: http://example.com
# The URL to the collection issue tracker
issues: http://example.com/issue/tracker
# A list of file glob-like patterns used to filter any files or directories that should not be included in the build
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
# and '.git' are always filtered
build_ignore: []
# Collections Plugins Directory
This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that
is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that
would contain module utils and modules respectively.
Here is an example directory of the majority of plugins currently supported by Ansible:
```
└── plugins
├── action
├── become
├── cache
├── callback
├── cliconf
├── connection
├── filter
├── httpapi
├── inventory
├── lookup
├── module_utils
├── modules
├── netconf
├── shell
├── strategy
├── terminal
├── test
└── vars
```
A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible/2.10/plugins/plugins.html).
This diff is collapsed.
[![](https://img.shields.io/liberapay/receives/cchaudier.svg?logo=liberapay)](https://liberapay.com/cchaudier/donate)
[![](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/badges/main/pipeline.svg)](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/-/pipelines)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![Ansible Role](https://img.shields.io/ansible/role/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![Ansible Quality Score](https://img.shields.io/ansible/quality/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![Ansible Role](https://img.shields.io/ansible/role/d/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![GitHub last commit](https://img.shields.io/github/last-commit/LydraFr/ansible-yunohost)](https://github.com/LydraFr/ansible-yunohost)
[![GitHub Release Date](https://img.shields.io/github/release-date/LydraFr/ansible-yunohost)](https://github.com/LydraFr/ansible-yunohost)
[![GitHub Repo stars](https://img.shields.io/github/stars/LydraFr/ansible-yunohost?style=social)](https://github.com/LydraFr/ansible-yunohost)
# Rôle Ansible : Yunohost Backup
[🇬🇧 English version](README.md)
Sauvegardez [Yunohost](https://yunohost.org/#/) avec Ansible !
## Prérequis
Yunohost doit déjà être installé sur votre serveur.
## Variables du rôle
Les variables par défaut sont disponibles dans `default/main.yml` cependant il est possible de les surcharger selon vos besoins en ...
### Gestion des sauvegardes
```yml
ynh_apps_backup:
scheduled: "true"
directory: "/data/backup"
scheduled_hour: "*"
scheduled_minute: "*/30"
scheduled_weekday: "*"
scheduled_month: "*"
src_script: "templates/ynh_apps_backup.sh.j2"
dest_script: "/usr/bin"
```
La tâche backup va permettre de sauvegarder les applications Yunohost ainsi que leurs données grâce à la mise en place d'une tâche cron.
- `ynh_apps_backup.scheduled` : active la fonctionnalité de sauvegarde des applications Yunohost, mettez la valeur à `True`.
- `ynh_apps_backup.directory` : le dossier de sauvegarde par défaut est `/home/yunohost.backup/archives` cependant vous pouvez tout à fait choisir de sauvegarder les backups dans un autre dossier grâce à cette variable. Dans ce cas, de manière à pouvoir restaurer les backups depuis l'interface web, Yunohost créé automatiquement un lien symbolique de l'archive créée vers son dossier par défaut.
- `ynh_apps_backup.scheduled_[hour|minute|weekday|month]`: modifie la planification de la tâche cron. Par défaut elle se déclenchera tous les jours de l'année à 1 heure du matin. Pour plus d'informations concernant les réglages horaires cron, cet outil peut être utile : <https://crontab.guru/>.
- `src_script`: il s'agit du chemin absolu où le fichier de template se situe sur la machine qui exécute Ansible. Par défaut, il sera stocké dans `templates/ynh_apps_backup.sh.j2`.
- `dest_script`: il s'agit du répertoire où le fichier de template va être stocké. Par défaut, il sera stocké dans `/usr/local/bin/`. Le script s'appelle `ynh_apps_backup.sh`.
## Dépendances
Aucune.
## Exemple de Playbook
```yml
---
- name: Install Yunohost on Debian Server
hosts: all
become: True
pre_tasks:
- name: Update all packages and index
ansible.builtin.apt:
upgrade: dist
update_cache: yes
roles:
- lydra.yunohost
```
## License
[![ansible-yunohost Copyright 2021 Lydra](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](https://choosealicense.com/licenses/gpl-3.0/)
**ansible-yunohost** est maintenu par [Lydra](https://lydra.fr/) et publié sous la licence GPL3.
[![](https://img.shields.io/liberapay/receives/cchaudier.svg?logo=liberapay)](https://liberapay.com/cchaudier/donate)
[![](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/badges/main/pipeline.svg)](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/-/pipelines)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![Ansible Role](https://img.shields.io/ansible/role/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![Ansible Quality Score](https://img.shields.io/ansible/quality/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![Ansible Role](https://img.shields.io/ansible/role/d/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![GitHub last commit](https://img.shields.io/github/last-commit/LydraFr/ansible-yunohost)](https://github.com/LydraFr/ansible-yunohost)
[![GitHub Release Date](https://img.shields.io/github/release-date/LydraFr/ansible-yunohost)](https://github.com/LydraFr/ansible-yunohost)
[![GitHub Repo stars](https://img.shields.io/github/stars/LydraFr/ansible-yunohost?style=social)](https://github.com/LydraFr/ansible-yunohost)
# Ansible Role: Yunohost
[🇫🇷 French version](README-FR.md)
Deploy [Yunohost](https://yunohost.org/#/) with Ansible!
## Requirements
Yunohost needs to be installed on your server.
## Role Variables
Default variables are available in `default/main.yml` however it is necessary to override them according to your needs for ...
### Backups management
```yml
ynh_apps_backup:
scheduled: "true"
directory: "/data/backup"
scheduled_hour: "*"
scheduled_minute: "*/30"
scheduled_weekday: "*"
scheduled_month: "*"
src_script: "templates/ynh_apps_backup.sh.j2"
dest_script: "/usr/bin"
```
The backup task will allow to backup Yunohost applications and their data by setting up a cron job.
- `ynh_apps_backup.scheduled`: to enable the Yunohost applications backup feature, set the value to `True`.
- `ynh_apps_backup.directory`: the default backup folder is `/home/yunohost.backup/archives` however you can choose to save the backups in another folder with this variable. In this case, in order to be able to restore the backups from the web interface, Yunohost automatically creates a symbolic link from the created archive to its default folder.
- `ynh_apps_backup.scheduled_[hour|minute|weekday|month]`: modifies the scheduling of the cron task. By default it will run every day of the year at 1am. For more information about cron time settings, this tool can be useful: <https://crontab.guru/>.
- `src_script`: this is the absolute path where the template file is located on the machine running Ansible. By default is will be stored in `templates/ynh_apps_backup.sh.j2`.
- `dest_script`: this is the directory where the template file will be stored. By default is will be stored in `/usr/local/bin`. The script is named `ynh_apps_backup.sh`.
## Dependencies
None.
## Example Playbook
```yml
---
- name: Install Yunohost on Debian Server
hosts: all
become: True
pre_tasks:
- name: Update all packages and index
ansible.builtin.apt:
upgrade: dist
update_cache: yes
roles:
- ansible-yunohost
```
## License
[![ansible-yunohost Copyright 2021 Lydra](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](https://choosealicense.com/licenses/gpl-3.0/)
**ansible-yunohost** is maintained by [Lydra](https://lydra.fr/) and released under the GPL3 license.
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# #
# this program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# this program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
#-----------------------------------------------------------------------------#
# Variables for apps backup
ynh_apps_backup:
scheduled: False
# directory: "/data/backup"
# scheduled_hour: 3
# scheduled_minute: "0"
# scheduled_weekday: "*"
# scheduled_month: "*"
# src_script: "templates/ynh_apps_backup.sh.j2"
# dest_script: "/usr/local/bin/"
---
galaxy_info:
role_name: ynh_backup
author: lydra
description: Backup Yunohost with Ansible
license: GPL-v3
min_ansible_version: 2.10
github_branch: main
platforms:
- name: Debian
versions:
- buster
galaxy_tags:
- yunohost
- cloud
- web
dependencies: []
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# #
# this program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# this program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
#-----------------------------------------------------------------------------#
- name: Create backup folder
ansible.builtin.file:
path: "{{ ynh_apps_backup.directory | default('/home/yunohost.backup/archives') }}"
state: directory
mode: '0750'
tags: test
- name: Create apps backup script
ansible.builtin.template:
src: "{{ ynh_apps_backup.src_script | default('templates/ynh_apps_backup.sh.j2') }}"
dest: "{{ ynh_apps_backup.dest_script | default('/usr/local/bin/') }}ynh_apps_backup.sh"
owner: root
group: root
mode: '0740'
tags: test
- name: Create cron task to perform YNH apps backup
ansible.builtin.cron:
name: "auto-backup apps to {{ ynh_apps_backup.directory | default('/home/yunohost.backup/archives') }}"
month: "{{ ynh_apps_backup.scheduled_month | default('*') }}"
weekday: "{{ ynh_apps_backup.scheduled_weekday | default('*') }}"
hour: "{{ ynh_apps_backup.scheduled_hour | default('1') }}"
minute: "{{ ynh_apps_backup.scheduled_minute | default('0') }}"
user: root
job: "{{ ynh_apps_backup.dest_script | default('/usr/local/bin/') }}ynh_apps_backup.sh"
cron_file: ynh_apps_backup_cron
tags: test
---
# tasks file for ynh_test
#!/bin/sh
{% if ynh_apps_backup.directory is string %}
yunohost backup create --apps --output-directory {{ ynh_apps_backup.directory }}/backup_$(date +%Y%m%d_%H%M)
{% else %}
yunohost backup create --apps
{% endif %}
---
# vars file for ynh_test
This diff is collapsed.
[![](https://img.shields.io/liberapay/receives/cchaudier.svg?logo=liberapay)](https://liberapay.com/cchaudier/donate)
[![](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/badges/main/pipeline.svg)](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/-/pipelines)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![Ansible Role](https://img.shields.io/ansible/role/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![Ansible Quality Score](https://img.shields.io/ansible/quality/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![Ansible Role](https://img.shields.io/ansible/role/d/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![GitHub last commit](https://img.shields.io/github/last-commit/LydraFr/ansible-yunohost)](https://github.com/LydraFr/ansible-yunohost)
[![GitHub Release Date](https://img.shields.io/github/release-date/LydraFr/ansible-yunohost)](https://github.com/LydraFr/ansible-yunohost)
[![GitHub Repo stars](https://img.shields.io/github/stars/LydraFr/ansible-yunohost?style=social)](https://github.com/LydraFr/ansible-yunohost)
# Rôle Ansible : Yunohost Backup
[🇬🇧 English version](README.md)
Sauvegardez [Yunohost](https://yunohost.org/#/) avec Ansible !
## Prérequis
Yunohost doit déjà être installé sur votre serveur.
## Variables du rôle
Les variables par défaut sont disponibles dans `default/main.yml` cependant il est possible de les surcharger selon vos besoins en ...
### Configuration d'un relais SMTP
```yml
# paramètres personnalisés du relais SMTP
ynh_smtp_relay:
host: smtp.domain.tld
port: 25
user: user1
password: Pa$$w0rd
```
Yunohost possède son propre serveur SMTP natif mais il est aussi possible de configurer Yunohost pour qu'il utilise un relais SMTP à la place.
Pour faire cela, créez la variable `ynh_smtp_relay` et mettez vos propres valeurs. Vous pouvez en apprendre plus sur les relais SMTP [ici](https://yunohost.org/fr/administrate/specific_use_cases/email_relay).
### Concernant les mises à jour
```yml
# Autoupdate Yunohost and its apps
ynh_autoupdate:
scheduled: True
special_time: "daily" #Choices are [annually,daily,hourly,monthly,reboot,weekly,yearly]
apps: True
system: True
dest_script: "/usr/bin/"
```
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`: est obligatoire. Elle permet de préciser quand vous souhaitez que cette tâche soit exécutée. Valeurs possibles : (`annually`,`daily`,`hourly`,`monthly`,`reboot`,`weekly`,`yearly`).
Pour en savoir plus sur les _special times_, cliquez [ici](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/cron_module.html).
- `ynh_autoupdate.apps` : est obligatoire. Activez la mise à jour automatique des applications Yunohost en mettant la valeur à `True`.
- `ynh_autoupdate.system` : est obligatoire. Activez la mise à jour automatique du système Yunohost en mettant la valeur à `True`.
- `ynh_autoupdate.dest_script` : c'est le chemin du répertoire où le script de mise à jour sera installé sur le serveur. La valeur par défaut est `/usr/local/bin`. Le script s'appelle `ynh_autoupdate.sh`.
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).
## Dépendances
Aucune.
## Exemple de Playbook
```yml
---
- name: Install Yunohost on Debian Server
hosts: all
become: True
pre_tasks:
- name: Update all packages and index
ansible.builtin.apt:
upgrade: dist
update_cache: yes
roles:
- lydra.yunohost
```
## License
[![ansible-yunohost Copyright 2021 Lydra](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](https://choosealicense.com/licenses/gpl-3.0/)
**ansible-yunohost** est maintenu par [Lydra](https://lydra.fr/) et publié sous la licence GPL3.
[![](https://img.shields.io/liberapay/receives/cchaudier.svg?logo=liberapay)](https://liberapay.com/cchaudier/donate)
[![](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/badges/main/pipeline.svg)](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/-/pipelines)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![Ansible Role](https://img.shields.io/ansible/role/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![Ansible Quality Score](https://img.shields.io/ansible/quality/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![Ansible Role](https://img.shields.io/ansible/role/d/56544)](https://galaxy.ansible.com/lydra/yunohost)
[![GitHub last commit](https://img.shields.io/github/last-commit/LydraFr/ansible-yunohost)](https://github.com/LydraFr/ansible-yunohost)
[![GitHub Release Date](https://img.shields.io/github/release-date/LydraFr/ansible-yunohost)](https://github.com/LydraFr/ansible-yunohost)
[![GitHub Repo stars](https://img.shields.io/github/stars/LydraFr/ansible-yunohost?style=social)](https://github.com/LydraFr/ansible-yunohost)
# Ansible Role: Yunohost
[🇫🇷 French version](README-FR.md)
Deploy [Yunohost](https://yunohost.org/#/) with Ansible!
## Requirements
None.
## Role Variables
Default variables are available in `default/main.yml` however it is necessary to override them according to your needs for Yunohost domains, users and apps.
### SMTP relay configuration
```yml
# SMTP custom settings
ynh_smtp_relay:
host: smtp.domain.tld
port: 25
user: user1
password: Pa$$w0rd
```
There is a built-in SMTP server on Yunohost but you can also set up Yunohost to use a SMTP relay instead.
In order to do so, create the `ynh_smtp_relay` variable and provide your own values. You can learn more about SMTP relay [here](https://yunohost.org/en/administrate/specific_use_cases/email_relay).
### About the updates
```yml
# Autoupdate Yunohost and its apps
ynh_autoupdate:
scheduled: True
special_time: "daily" #Choices are [annually,daily,hourly,monthly,reboot,weekly,yearly]
apps: True
system: True
dest_script: "/usr/bin/"
```
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` : enables the cron job by setting the value to `True`.
- `ynh_autoupdate.special_time`: it is mandatory. It allows you to specify when you want this task to be executed. Possible values: (`annually`,`daily`,`hourly`,`monthly`,`reboot`,`weekly`,`yearly`). To learn more about special times, click [here](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/cron_module.html).
- `ynh_autoupdate.apps`: is mandatory. Enable automatic updating of Yunohost applications by setting the value to `True`.
- `ynh_autoupdate.system`: is mandatory. Enable automatic updating of the Yunohost system by setting the value to `True`.
- `ynh_autoupdate.dest_script`: it is the path to the directory where the update script will be installed on the server. The default value is `/usr/local/bin`. The script is named `ynh_autoupdate.sh`.
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).
## Dependencies
None.
## Example Playbook
```yml
---
- name: Install Yunohost on Debian Server
hosts: all
become: True
pre_tasks:
- name: Update all packages and index
ansible.builtin.apt:
upgrade: dist
update_cache: yes
roles:
- ansible-yunohost
```
## License
[![ansible-yunohost Copyright 2021 Lydra](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](https://choosealicense.com/licenses/gpl-3.0/)
**ansible-yunohost** is maintained by [Lydra](https://lydra.fr/) and released under the GPL3 license.
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# #
# this program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# this program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
#-----------------------------------------------------------------------------#
# Do not touch this variable
# Just to have dict default value
ynh_smtp_relay:
value: null
# SMTP custom settings (Only override if you need a SMTP relay)
# Example:
# ynh_smtp_relay:
# host: smtp.domain.tld
# port: "25"
# user: user1
# password: Pa$$w0rd
# Autoupdate Yunohost and its apps
ynh_autoupdate:
scheduled: False
# special_time: "daily" #Choices are [annually,daily,hourly,monthly,reboot,weekly,yearly]
# apps: True
# system: True
# dest_script: "/usr/local/bin/"
---
galaxy_info:
role_name: ynh_config
author: lydra
description: Configure Yunohost with Ansible
license: GPL-v3
min_ansible_version: 2.10
github_branch: main
platforms:
- name: Debian
versions:
- buster
galaxy_tags:
- yunohost
- cloud
- web
dependencies: []
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# #
# this program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# this program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
#-----------------------------------------------------------------------------#
- name: Creates Yunohost autoupdate script
ansible.builtin.template:
src: "templates/ynh_autoupdate.sh.j2"
dest: "{{ ynh_autoupdate.dest_script | default('/usr/local/bin/') }}ynh_autoupdate.sh"
owner: root
group: root
mode: '0740'
- name: Creates 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: "{{ ynh_autoupdate.dest_script | default('/usr/local/bin/') }}ynh_autoupdate.sh"
cron_file: ynh_autoupdate_cron
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