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

--wip-- [skip ci]

parent 5ee31aab
No related branches found
No related tags found
No related merge requests found
Pipeline #8359 skipped
...@@ -70,6 +70,24 @@ Cette tâche utilisant le module template, vous pouvez tout à fait utiliser vos ...@@ -70,6 +70,24 @@ 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.
### Gestion des conteneurs Docker
Par défaut, les applications de YunoHost sont prépackagées par les membres de la communauté. Nous avons décidé d'aller plus loin, en ajoutant simplement la possibilité de déployer des conteneurs Docker et de les intégrer au panel d'applications YunoHost.
```yml
enable_ynh_docker: True
```
```yml
- label: "Redirection de l'application ara"
link: "redirect"
args:
domain: "ara.{{ ynh_main_domain }}"
path: "/"
redirect_path: "http://0.0.0.0:8000"
redirect_type: "public_proxy"
```
Si vous voulez aller plus loin, [le rôle de hadret](https://github.com/hadret/ansible-role-containers) est tout à fait approprié.
## Dépendances ## Dépendances
Aucune. Aucune.
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # # along with this program. If not, see <http://www.gnu.org/licenses/>. #
# # # #
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
# The list of Yunohost apps. # The list of Yunohost apps.
ynh_apps: null ynh_apps: null
# - label: Tiny Tiny RSS # - label: Tiny Tiny RSS
...@@ -31,3 +30,16 @@ ynh_apps: null ...@@ -31,3 +30,16 @@ ynh_apps: null
# type: script # type: script
# 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
# Variables for Docker
enable_ynh_docker: False
geerlingguy_docker_version: 5.2.0
# Variables for Docker Compose
# compose_version: 3.9
# compose_service_image: "recordsansible/ara-api:latest"
# compose_service_name: "app"
# compose_service_ports:
# - 8000:8000
# compose_service_volumes:
# - "/home/{{ ynh_admin }}/.ara/server:/opt/ara"
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# 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 #
# 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: Download Docker setup role on localhost
ansible.builtin.command: "ansible-galaxy install geerlingguy.docker,{{ geerlingguy_docker_version }} -p {{ _ansible_role_directory }}"
delegate_to: localhost
become: False
tags: docker
- name: Gather facts for Docker role
ansible.builtin.setup:
tags: docker
- name: Install Docker and Docker Compose
ansible.builtin.import_role:
name: geerlingguy.docker
tags: docker
# First option
- name: Copy Docker Compose file
ansible.builtin.template:
src: templates/compose.yml.j2
dest: /tmp/app
mode: 0644
tags: docker
- name: Run Docker Compose file
community.docker.docker_compose:
project_src: /tmp/app
state: present
tags: docker
# Second option
- name: Create Docker container from
community.general.docker_container:
project_name: myapp
definition:
version: "{{ compose_version }}"
services:
"{{ compose_service_name }}"
image: "{{ compose_service_image }}"
ports:
{% for port in compose_service_ports %}
- "{{ port }}"
{% endfor %}
volumes:
{% for volume in compose_service_volumes %}
- "{{ volume }}"
{% endfor %}
tags: docker
...@@ -17,8 +17,12 @@ ...@@ -17,8 +17,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # # along with this program. If not, see <http://www.gnu.org/licenses/>. #
# # # #
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
- 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: apps tags: apps
- name: Install Docker and its apps
ansible.builtin.include_tasks: docker.yml
when: enable_ynh_docker
tags: docker
version: "{{ compose_version }}"
services:
"{{ compose_service_name }}":
image: "{{ compose_service_image }}"
ports:
{% for port in compose_service_ports %}
- "{{ port }}"
{% endfor %}
volumes:
{% for volume in compose_service_volumes %}
- "{{ volume }}"
{% endfor %}
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