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

feat: adds symlink management

parent 5b78dd4c
No related branches found
No related tags found
1 merge request!22Resolve "Create a collection"
...@@ -45,6 +45,7 @@ Ces tags sont applicables suivant les rôles. ...@@ -45,6 +45,7 @@ Ces tags sont applicables suivant les rôles.
|smtp|Tâches liées aux paramètres de relais smtp de Yunohost.| |smtp|Tâches liées aux paramètres de relais smtp de Yunohost.|
|backup|Tâches liées aux sauvegardes de Yunohost.| |backup|Tâches liées aux sauvegardes de Yunohost.|
|pkg|Tâches d'installation de paquets.| |pkg|Tâches d'installation de paquets.|
|linux|Tâches liées à l'OS Linux.|
## License ## License
......
...@@ -45,6 +45,7 @@ These tags are applicable to roles. ...@@ -45,6 +45,7 @@ These tags are applicable to roles.
|smtp|Tasks related to Yunohost smtp relay settings.| |smtp|Tasks related to Yunohost smtp relay settings.|
|backup|Tasks related to Yunohost backups.| |backup|Tasks related to Yunohost backups.|
|pkg|Tasks that install packages.| |pkg|Tasks that install packages.|
|linux|Tasks related to Linux OS.|
## License ## License
......
...@@ -19,11 +19,24 @@ Les variables par défaut sont disponibles dans `default/main.yml` cependant il ...@@ -19,11 +19,24 @@ Les variables par défaut sont disponibles dans `default/main.yml` cependant il
ynh_install_script_url: https://install.yunohost.org ynh_install_script_url: https://install.yunohost.org
ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS
ynh_dir: "/data/yunohost"
ynh_data_dirs:
- path: "{{ ynh_dir }}/etc"
link: "/etc/yunohost"
- path: "{{ ynh_dir }}/var"
link: "/var/www"
ynh_data_dirs.enabled: True
``` ```
- `ynh_install_script_url` est le script d'installation des packages Yunohost, par défaut c'est le script officiel. Yunohost ne s'installe que sur Debian 10. - `ynh_install_script_url` est le script d'installation des packages Yunohost, par défaut c'est le script officiel. Yunohost ne s'installe que sur Debian 10.
- `ynh_admin_password` est le mot de passe permettant d'accéder à l’interface d’administration du serveur. - `ynh_admin_password` est le mot de passe permettant d'accéder à l’interface d’administration du serveur.
- `ynh_data_dirs.enabled`: active les liens symboliques et permet de déplacer les répertoires de configurations et de données de YunoHost où vous le desirez. Mettez la valeur à `True`.
- `ynh_data_dirs.path`: il s'agit des répertoires où stocker les données de configuration de Yunohost ainsi que les applications.
- `ynh_data_dirs.link`: il s'agit des répertoire où seront fait les liens symboliques.
### Gestion des domaines ### Gestion des domaines
```yml ```yml
......
...@@ -19,11 +19,24 @@ Default variables are available in `default/main.yml` however it is necessary to ...@@ -19,11 +19,24 @@ Default variables are available in `default/main.yml` however it is necessary to
ynh_install_script_url: https://install.yunohost.org ynh_install_script_url: https://install.yunohost.org
ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS
ynh_dir: "/data/yunohost"
ynh_data_dirs:
- path: "{{ ynh_dir }}/etc"
link: "/etc/yunohost"
- path: "{{ ynh_dir }}/var"
link: "/var/www"
ynh_data_dirs.enabled: True
``` ```
- `ynh_install_script_url` downloads official Yunohost script for installing Yunohost packages. Yunohost is only available on Debian 10. - `ynh_install_script_url` downloads official Yunohost script for installing Yunohost packages. Yunohost is only available on Debian 10.
- `ynh_admin_password` is the password used to access to the server's administration interface. - `ynh_admin_password` is the password used to access to the server's administration interface.
- `ynh_data_dirs.enabled`: Enables symbolic links and allows you to move YunoHost's configuration and data directories wherever you want. Set the value to `True`.
- `ynh_data_dirs.path`: these are the directories where Yunohost configuration data and applications are stored.
- `ynh_data_dirs.link`: this is the directory where symbolic links will be made.
### Domain management ### Domain management
```yml ```yml
......
...@@ -23,6 +23,15 @@ ynh_install_script_url: https://install.yunohost.org ...@@ -23,6 +23,15 @@ ynh_install_script_url: https://install.yunohost.org
ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS
ynh_dir: "/data/yunohost"
ynh_data_dirs:
- path: "{{ ynh_dir }}/etc"
link: "/etc/yunohost"
- path: "{{ ynh_dir }}/var"
link: "/var/www"
ynh_data_dirs_enabled: True
# The list of Yunohost domains. # The list of Yunohost domains.
ynh_main_domain: domain.tld ynh_main_domain: domain.tld
ynh_extra_domains: null ynh_extra_domains: null
......
...@@ -27,40 +27,28 @@ ...@@ -27,40 +27,28 @@
tags: tags:
- pkg - pkg
- linux - linux
- yunohost
- name: Create apps and config directories - name: Create data and config subdirs of Yunohost
ansible.builtin.file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item.path }}"
state: directory state: directory
mode: 0770 mode: "0755"
loop: with_items:
- "{{ ynh_symlink.appdata_dir }}" - "{{ ynh_data_dirs }}"
- "{{ ynh_symlink.conf_dir }}"
tags: tags:
- linux - linux
- yunohost when: ynh_data_dirs_enabled
when: ynh_symlink.enabled
- name: Create symbolic link for Yunohost apps data directory - name: Create symbolic links for Yunohost subdirs
ansible.builtin.file: ansible.builtin.file:
src: /var/www/ src: "{{ item.path }}"
dest: "{{ ynh_symlink.appdata_dir }}/www_symlink" dest: "{{ item.link }}"
state: link state: link
with_items:
- "{{ ynh_data_dirs }}"
tags: tags:
- linux - linux
- yunohost when: ynh_data_dirs_enabled
when: ynh_symlink.enabled
- name: Create symbolic link for Yunohost configuration directory
ansible.builtin.file:
src: /etc/yunohost/
dest: "{{ ynh_symlink.conf_dir }}/yunohost_symlink"
state: link
tags:
- linux
- yunohost
when: ynh_symlink.enabled
- name: Test if Yunohost is already installed - name: Test if Yunohost is already installed
ansible.builtin.stat: path=/etc/yunohost/installed ansible.builtin.stat: path=/etc/yunohost/installed
......
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