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
main.yml 3.52 KiB
Newer Older
sylvainar's avatar
sylvainar committed
---
#-----------------------------------------------------------------------------#
# 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: Update all packages and index
  ansible.builtin.apt:
    upgrade: dist
    update_cache: yes
  tags:
    - pkg
    - linux
sylvainar's avatar
sylvainar committed
- name: Install requirements
  ansible.builtin.apt:
sylvainar's avatar
sylvainar committed
    name:
      - git
      - dialog
    state: present
- name: Create data and config subdirs of Yunohost
    path: "{{ item.path }}"
    mode: "0755"
  with_items:
    - "{{ ynh_data_dirs }}"
  when: ynh_data_dirs_enabled
- name: Create symbolic links for Yunohost subdirs
    src: "{{ item.path }}"
    dest: "{{ item.link }}"
  with_items:
  when: ynh_data_dirs_enabled
sylvainar's avatar
sylvainar committed

- name: Test if Yunohost is already installed
  ansible.builtin.stat: path=/etc/yunohost/installed
  register: ynh_file_install
sylvainar's avatar
sylvainar committed

- name: Download Yunohost install script
  ansible.builtin.get_url:
    url: "{{ ynh_install_script_url }}"
sylvainar's avatar
sylvainar committed
    dest: /tmp/install_yunohost.sh
    mode: 700
  when: not ynh_file_install.stat.exists
sylvainar's avatar
sylvainar committed

- name: Launch Yunohost install script
  ansible.builtin.command: /tmp/install_yunohost.sh -a
  when: not ynh_file_install.stat.exists
sylvainar's avatar
sylvainar committed

- name: Launch Yunohost postinstall
sylvainar's avatar
sylvainar committed
    yunohost tools postinstall \
      --domain "{{ ynh_main_domain }}" \
      --password "{{ ynh_admin_password }}" \
      {% if ynh_ignore_dyndns_server %} --ignore-dyndns {% endif %}
  when: not ynh_file_install.stat.exists
sylvainar's avatar
sylvainar committed

- name: Create extra domains
- name: Run first Yunohost diagnosis
  ansible.builtin.command: yunohost diagnosis run
  when: not ynh_file_install.stat.exists
- name: Install domain certificates
  ansible.builtin.command: yunohost domain cert-install
  changed_when: False
- name: Add Yunohost users