39bd859070
Ansible-lint: ``` Include has some unintuitive behaviours depending on if it is running in a static or dynamic in play or in playbook context, in an effort to clarify behaviours we are moving to a new set modules (ansible.builtin.include_tasks, ansible.builtin.include_role, ansible.builtin.import_playbook, ansible.builtin.import_tasks) that have well established and clear behaviours. This module will still be supported for some time but we are looking at deprecating it in the near future. ``` Fix: I have decided to go for ansible include_tasks module because it is more versatile and on a par with this module (for more info about differences between new modules, see [here](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_module.html)
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
---
|
|
- name: Install requirements
|
|
ansible.builtin.apt:
|
|
name:
|
|
- git
|
|
- dialog
|
|
state: present
|
|
|
|
- name: Test if Yunohost is already installed
|
|
ansible.builtin.stat: path=/etc/yunohost/installed
|
|
register: ynh_file_install
|
|
|
|
- name: Download Yunohost install script
|
|
ansible.builtin.get_url:
|
|
url: "{{ ynh_install_script_url }}"
|
|
dest: /tmp/install_yunohost.sh
|
|
mode: 700
|
|
when: ynh_file_install.stat.exists == False
|
|
|
|
- name: Launch Yunohost install script
|
|
ansible.builtin.command: /tmp/install_yunohost.sh -a
|
|
when: ynh_file_install.stat.exists == False
|
|
|
|
- name: Launch Yunohost postinstall
|
|
ansible.builtin.command:
|
|
yunohost tools postinstall \
|
|
--domain "{{ ynh_main_domain }}" \
|
|
--password "{{ ynh_admin_password }}" \
|
|
{% if ynh_ignore_dyndns_server == True %} --ignore-dyndns {% endif %}
|
|
when: ynh_file_install.stat.exists == False
|
|
|
|
- name: Create extra domains
|
|
ansible.builtin.include_tasks: domains.yml
|
|
when: ynh_extra_domains
|
|
|
|
- name: Run first Yunohost diagnosis
|
|
ansible.builtin.command: yunohost diagnosis run
|
|
|
|
- name: Install domain certificates
|
|
ansible.builtin.command: yunohost domain cert-install
|
|
changed_when: False
|
|
|
|
- name: Add Yunohost users
|
|
ansible.builtin.include_tasks: users.yml
|
|
when: ynh_users
|
|
|
|
- name: Install Yunohost apps
|
|
ansible.builtin.include_tasks: apps.yml
|
|
when: ynh_apps
|