1
0
Fork 0
ynh-lydra-ansible-yunohost/tasks/main.yml

79 lines
3 KiB
YAML
Raw Normal View History

2017-08-23 12:58:21 +02:00
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 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/>. #
# #
#-----------------------------------------------------------------------------#
2017-08-23 12:58:21 +02:00
- name: Install requirements
ansible.builtin.apt:
2017-08-23 12:58:21 +02:00
name:
- git
- dialog
state: present
- name: Test if Yunohost is already installed
ansible.builtin.stat: path=/etc/yunohost/installed
register: ynh_file_install
2017-08-23 12:58:21 +02:00
- name: Download Yunohost install script
ansible.builtin.get_url:
url: "{{ ynh_install_script_url }}"
2017-08-23 12:58:21 +02:00
dest: /tmp/install_yunohost.sh
mode: 700
when: not ynh_file_install.stat.exists
2017-08-23 12:58:21 +02:00
- name: Launch Yunohost install script
ansible.builtin.command: /tmp/install_yunohost.sh -a
when: not ynh_file_install.stat.exists
2017-08-23 12:58:21 +02:00
- name: Launch Yunohost postinstall
ansible.builtin.command:
2017-08-23 12:58:21 +02:00
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
2017-08-23 12:58:21 +02:00
- name: Create extra domains
ansible.builtin.include_tasks: domains.yml
when: ynh_extra_domains
2017-08-24 22:39:58 +02:00
- 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
2017-08-24 22:39:58 +02:00
changed_when: False
2017-08-23 15:23:31 +02:00
2021-10-26 15:52:28 +02:00
- name: Configure SMTP relay
ansible.builtin.include_tasks: smtp_relay.yml
loop: "{{ ynh_smtp_relay | dict2items }}"
when: item.value
- name: Add Yunohost users
ansible.builtin.include_tasks: users.yml
when: ynh_users
2017-09-17 21:25:30 +02:00
- name: Install Yunohost apps
ansible.builtin.include_tasks: apps.yml
when: ynh_apps
- name: Configures Yunohost autoupdate
ansible.builtin.include_tasks: autoupdate.yml
when: ynh_autoupdate.scheduled