2017-08-23 12:58:21 +02:00
|
|
|
---
|
|
|
|
- name: Install requirements
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.apt:
|
2017-08-23 12:58:21 +02:00
|
|
|
name:
|
|
|
|
- git
|
|
|
|
- dialog
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Test if Yunohost is already installed
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.stat: path=/etc/yunohost/installed
|
2017-08-23 12:58:21 +02:00
|
|
|
register: yunohost_file_install
|
|
|
|
|
|
|
|
- name: Download install script
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.get_url:
|
2017-08-23 12:58:21 +02:00
|
|
|
url: "{{ yunohost.install_script_url }}"
|
|
|
|
dest: /tmp/install_yunohost.sh
|
|
|
|
mode: 700
|
|
|
|
when: yunohost_file_install.stat.exists == False
|
|
|
|
|
|
|
|
- name: Launch script
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.command: /tmp/install_yunohost.sh -a
|
2017-08-23 12:58:21 +02:00
|
|
|
when: yunohost_file_install.stat.exists == False
|
|
|
|
|
|
|
|
- name: Launch postinsstall
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.shell: "
|
2017-08-23 12:58:21 +02:00
|
|
|
yunohost tools postinstall \
|
|
|
|
--domain {{ yunohost.domain }} \
|
|
|
|
--password {{ yunohost.password }} \
|
|
|
|
{% if yunohost.ignore_dyndns == True %} --ignore-dyndns {% endif %}
|
|
|
|
"
|
|
|
|
when: yunohost_file_install.stat.exists == False
|
|
|
|
|
2017-08-24 22:39:58 +02:00
|
|
|
- name: Create domains
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.include: domains.yml
|
2017-08-24 22:39:58 +02:00
|
|
|
when: yunohost.extra_domains
|
|
|
|
|
2020-11-16 07:52:20 +01:00
|
|
|
- name: Run diagnosis # Required to install certificates
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.shell: yunohost diagnosis run
|
2020-11-16 07:52:20 +01:00
|
|
|
|
2017-08-23 12:58:21 +02:00
|
|
|
- name: Install certificates
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.shell: yunohost domain cert-install
|
2017-08-24 22:39:58 +02:00
|
|
|
changed_when: False
|
2017-08-23 15:23:31 +02:00
|
|
|
|
2017-09-17 21:25:30 +02:00
|
|
|
- name: Add users
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.include: users.yml
|
2017-09-17 21:25:30 +02:00
|
|
|
when: yunohost.users
|
|
|
|
|
2021-05-01 19:57:06 +02:00
|
|
|
- name: Add ssh for admin user
|
|
|
|
ansible.builtin.include: admin_users.yml
|
|
|
|
when: yunohost.admin_users is defined
|
|
|
|
|
2017-08-23 15:23:31 +02:00
|
|
|
- name: Install apps
|
2021-05-01 17:13:18 +02:00
|
|
|
ansible.builtin.include: apps.yml
|
2017-08-23 15:23:31 +02:00
|
|
|
when: yunohost.apps
|