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

refactor: Apply suggestions

parent f98acf10
No related branches found
No related tags found
No related merge requests found
Pipeline #3726 passed with warnings
Showing
with 100 additions and 1435 deletions
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# Copyright 2021-present 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 #
......
......@@ -8,7 +8,7 @@
[![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)
# Collection Ansible - lydra.yunohost
Collection Ansible - lydra.yunohost
[🇬🇧 English version](README.md)
......@@ -17,18 +17,22 @@ Comme il s'agit d'une collection indépendante, elle peut être publiée selon s
## Prérequis
------------
Votre serveur doit être basé sur du Debian Buster et Yunohost ne doit pas déjà être installé.
## Contenu de la collection
### Rôles
- `lydra.yunohost.ynh_setup` : Ce rôle prépare les serveurs à base de Debian-Buster à exécuter Yunohost. Il configure Yunohost avec ses paramètres initiaux et les domaines, utilisateurs et applications de votre choix.
- `lydra.yunohost.ynh_config` : Ce rôle gère la configuration de différents services de Yunohost (relais SMTP, mises à jour automatiques).
- `lydra.yunohost.ynh_backup` : Ce rôle gère la configuration des sauvegardes.
- [`lydra.yunohost.ynh_setup`](roles/ynh_setup/README-FR.md) : Ce rôle prépare les serveurs à base de Debian-Buster à exécuter Yunohost. Il configure Yunohost avec ses paramètres initiaux et les domaines, utilisateurs et applications de votre choix.
- [`lydra.yunohost.ynh_config`](roles/ynh_config/README-FR.md) : Ce rôle gère la configuration de différents services de Yunohost (relais SMTP, mises à jour automatiques).
- [`lydra.yunohost.ynh_backup`](roles/ynh_backup/README-FR.md) : Ce rôle gère la configuration des sauvegardes.
### lydra.yunohost Tags du rôle
------------
Ces tags sont applicables suivant les rôles.
|tags|commentaires|
......@@ -44,6 +48,8 @@ Ces tags sont applicables suivant les rôles.
## 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.
......@@ -17,18 +17,22 @@ As this is an independent collection, it can be released on its own release cade
# Prerequisites
------------
Your server must be Debian-Buster based and Yunohost shouldn't be already installed.
## Collection contents
### Roles
- `lydra.yunohost.ynh_setup` : This role prepares servers with Debian-Buster-based to run Yunohost. It sets up Yunohost with its initial settings and domains, users and apps of your choice.
- `lydra.yunohost.ynh_config` : This role configures various Yunohost services (SMTP relay, auto updates).
- `lydra.yunohost.ynh_backup` : This role manages the configuration of backups.
- [`lydra.yunohost.ynh_setup`](roles/ynh_setup/README.md): This role prepares servers with Debian-Buster-based to run Yunohost. It sets up Yunohost with its initial settings and domains, users and apps of your choice.
- [`lydra.yunohost.ynh_config`](roles/ynh_config/README.md): This role configures various Yunohost services (SMTP relay, auto updates).
- [`lydra.yunohost.ynh_backup`](roles/ynh_backup/README.md): This role manages the configuration of backups.
## lydra.yunohost Role Tags
------------
These tags are applicable to roles.
|tags|comment|
......@@ -44,6 +48,8 @@ These tags are applicable to roles.
## 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.
......@@ -55,7 +55,7 @@ documentation: https://github.com/LydraFr/ansible-yunohost/blob/main/README.md
homepage: https://github.com/LydraFr/ansible-yunohost
# The URL to the collection issue tracker
issues: http://example.com/issue/tracker
issues: https://lab.frogg.it/lydra/yunohost/ansible-yunohost/-/issues
# 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
......
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)
......@@ -16,14 +6,20 @@ 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_backup:
scheduled: True
......@@ -50,10 +46,14 @@ La tâche backup va permettre de sauvegarder les applications Yunohost ainsi que
## Dépendances
------------
Aucune.
## Exemple de Playbook
------------
```yml
---
- name: Configure Yunohost backups
......@@ -67,6 +67,8 @@ Aucune.
## 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)
......@@ -16,14 +6,20 @@ 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_backup:
scheduled: True
......@@ -50,10 +46,14 @@ The backup task will allow to backup Yunohost applications and their data by set
## Dependencies
------------
None.
## Example Playbook
------------
```yml
---
- name: Configure Yunohost backups
......@@ -67,6 +67,8 @@ None.
## 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/ #
# Copyright 2021-present 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 #
......
......@@ -7,9 +7,9 @@ galaxy_info:
min_ansible_version: 2.10
github_branch: main
platforms:
- name: Debian
versions:
- buster
- name: Debian
versions:
- buster
galaxy_tags:
- yunohost
- cloud
......
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# Copyright 2021-present 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 #
......@@ -24,7 +24,7 @@
state: directory
mode: '0750'
tags:
- "backup"
- backup
- name: Create backup script
ansible.builtin.template:
......@@ -34,8 +34,8 @@
group: root
mode: '0740'
tags:
- "backup"
- "cron"
- backup
- cron
- name: Create cron task to perform YNH backup
ansible.builtin.cron:
......@@ -48,5 +48,5 @@
job: "{{ ynh_backup.dest_script | default('/usr/local/bin/') }}ynh_backup.sh"
cron_file: ynh_backup_cron
tags:
- "backup"
- "cron"
- backup
- cron
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# Copyright 2021-present 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 #
......@@ -22,4 +22,4 @@
ansible.builtin.include_tasks: backup.yml
when: ynh_backup.scheduled
tags:
- "backup"
- backup
#!/bin/sh
{% if ynh_backup.system and ynh_backup.apps and ynh_backup.directory %}
yunohost backup create --output-directory {{ ynh_backup.directory }}/backup_$(date +%Y%m%d_%H%M)
{% elif ynh_backup.system and ynh_backup.apps %}
yunohost backup create
{% elif ynh_backup.system %}
yunohost backup create --system
{% elif ynh_backup.apps %}
yunohost backup create --apps
{% endif %}
yunohost backup create {% if ynh_backup.system %}--system{% endif %}{% if ynh_backup.apps %} --apps{% endif %}{% if ynh_backup.directory %} --output-directory {{ ynh_backup.directory }}/backup_$(date +%Y%m%d_%H%M) {% endif %}
{% if ynh_backup.system is false and ynh_backup.apps is false %}
echo "Read the readme to know more about ynh_backup.system and ynh_backup.apps"
echo "TO BE DEFINED"
echo "Read the readme to know more about vars ynh_backup.system and ynh_backup.apps"
exit 1
{% endif %}
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 Configuration
[🇬🇧 English version](README.md)
......@@ -20,10 +10,14 @@ 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.
### Configuration d'un relais SMTP
------------
```yml
# paramètres personnalisés du relais SMTP
ynh_smtp_relay:
......@@ -38,6 +32,8 @@ Pour faire cela, créez la variable `ynh_smtp_relay` et mettez vos propres valeu
### Concernant les mises à jour
------------
```yml
# Autoupdate Yunohost and its apps
ynh_autoupdate:
......@@ -62,10 +58,14 @@ Pour en savoir plus sur le fonctionnement des mises à jour dans Yunohost vous p
## Dépendances
------------
Aucune.
## Exemple de Playbook
------------
```yml
---
- name: Configure Yunohost on Debian Server
......@@ -79,6 +79,8 @@ Aucune.
## 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)
......@@ -16,14 +6,20 @@ 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:
......@@ -38,6 +34,8 @@ In order to do so, create the `ynh_smtp_relay` variable and provide your own val
### About the updates
------------
```yml
# Autoupdate Yunohost and its apps
ynh_autoupdate:
......@@ -62,10 +60,14 @@ To learn more about how updates work in Yunohost you can go [here](https://yunoh
## Dependencies
------------
None.
## Example Playbook
------------
```yml
---
- name: Configure Yunohost on Debian Server
......@@ -79,6 +81,8 @@ None.
## 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/ #
# Copyright 2021-present 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 #
......
......@@ -7,9 +7,9 @@ galaxy_info:
min_ansible_version: 2.10
github_branch: main
platforms:
- name: Debian
versions:
- buster
- name: Debian
versions:
- buster
galaxy_tags:
- yunohost
- cloud
......
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# Copyright 2021-present 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 #
......@@ -26,8 +26,8 @@
group: root
mode: '0740'
tags:
- "update"
- "cron"
- update
- cron
- name: Creates cron task under /etc/cron.d to auto-update Yunohost
ansible.builtin.cron:
......@@ -38,5 +38,5 @@
job: "{{ ynh_autoupdate.dest_script | default('/usr/local/bin/') }}ynh_autoupdate.sh"
cron_file: ynh_autoupdate_cron
tags:
- "update"
- "cron"
- update
- cron
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# Copyright 2021-present 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 #
......@@ -23,10 +23,10 @@
loop: "{{ ynh_smtp_relay | dict2items }}"
when: item.value
tags:
- "smtp"
- smtp
- name: Configures Yunohost autoupdate
ansible.builtin.include_tasks: autoupdate.yml
when: ynh_autoupdate.scheduled
tags:
- "update"
- update
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# Copyright 2021-present 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 #
......@@ -24,11 +24,11 @@
register: _ynh_smtp_current_values
changed_when: False
tags:
- "smtp"
- smtp
- name: Set new SMTP settings
ansible.builtin.command:
"yunohost settings set smtp.relay.{{ item.key }} -v {{ item.value }}"
when: _ynh_smtp_current_values.stdout != item.value
tags:
- "smtp"
- smtp
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