1
0
Fork 0
No description
Find a file
2021-11-09 13:45:41 +00:00
defaults feat: add app post_install 2021-11-09 13:45:41 +00:00
meta refactor: Added GNU licence info + lydra copyright 2021-10-19 08:29:57 +00:00
tasks feat: add app post_install 2021-11-09 13:45:41 +00:00
.gitlab-ci.yml refactor: Added GNU licence info + lydra copyright 2021-10-19 08:29:57 +00:00
LICENSE Initial commit 2017-08-23 12:42:15 +02:00
README-FR.md feat: add app post_install 2021-11-09 13:45:41 +00:00
README.md feat: add app post_install 2021-11-09 13:45:41 +00:00

License: GPL v3 Ansible Role Ansible Quality Score Ansible Role GitHub last commit GitHub Release Date GitHub Repo stars

Ansible Role: Yunohost

🇫🇷 French version

Deploy Yunohost 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.

Yunohost Installation

# Debian 10 script only.
ynh_install_script_url: https://install.yunohost.org

ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS
  • 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.

Domain management

# The list of Yunohost domains.
ynh_main_domain: domain.tld
ynh_extra_domains:
  - forum.domain.tld
  - wiki.domain.tld
ynh_ignore_dyndns_server: False
  • ynh_main_domain is the main domain used by the server's users to access the authentication portal. If you already own a domain name, you probably want to use it here. You can also use a domain in .nohost.me / .noho.st / .ynh.fr (more info here).
  • ynh_extra_domains are optional and allow you to install one app per subdomain (more info here).
  • ynh_ignore_dyndns_server allow to register domains with a Dynamic DNS service (more info here).

SMTP relay configuration

# 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.

User management

# The list of Yunohost users.
ynh_users:
   - name: user1
     pass: MYINSECUREPWD_PLZ_OVERRIDE_THIS
     firstname: Jane
     lastname: Doe
     mail_domain: domain.tld
  • ynh_users is the list of users to create. Each field is mandatory. Some Yunohost applications require that a user be the app administrator. He will then have the right to manage the application from the server administration interface. You can learn more about Yunohost user management here.

App management

# The list of Yunohost apps.
ynh_apps:
  - label: WikiJS
    link: wikijs
    args:
      domain: wiki.domain.tld
      path: /
      admin: user1
      is_public: no
  - label: Discourse
    link: discourse
    args:
      domain: forum.domain.tld
      path: /
      admin: user1
      is_public: yes
    post_install:
      - src: "templates/site_settings.yml.j2"
        dest: "/var/www/discourse/config/site_settings.yml"
        type: "config"

      - src: "templates/configure_discourse.sh.j2"
        dest: "/tmp/configure_discourse.sh"
        type: "script"
        owner: root
        group: root
  • ynh_apps is the list of applications to install.
  • label allows you to give a custom name to the application on the user interface.
  • link is the name of the Yunohost application to install.

About the arguments:

  • domain is essential. You have to choose one of the domains of your Yunohost instance.
  • path is required. You have to choose a URL to access your application like domain.tld/my_app. Just use / if the application is to be installed on a subdomain.
  • is_public argument is a common one. Set to yes, the application will be accessible to everyone, even without authentication to the Yunohost SSO portal. Set to no, the application will be accessible only after authentication.

For the other arguments, you have to refer to the manifest.json available in the repository of the Yunohost application you install. You can learn more about this part here.

About the post-installation:

It is possible to complete the installation of applications by adding jinja template configuration files or scripts written by yourself. To enable this feature, define the post_install variable which corresponds to the list of post-installation files of your applications. Because this task uses the template module, you can use your own variables and call them in your template files. To know more about this module, click here.

  • src is mandatory. This is the directory where the template file is located on the machine running Ansible.
  • dest is mandatory. This is the directory where the template file will be stored.
  • type is mandatory:
    • If you specify script as the value, then the template file will have 740 rights. It will be executed after it is transferred to the Yunohost server (usually in /tmp/) and then deleted.
    • If you specify config as the value, then the template file will have 660 rights. It will be transferred to the Yunohost server (usually in /var/www/AppName/) and after you could import it with a shell script on the side for example.

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.

Dependencies

None.

Example Playbook

---
- 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

ansible-yunohost is maintained by Lydra and released under the GPL3 license.