| @@ -53,7 +53,7 @@ You can either [run Ansible in a container on the Matrix server itself](#running | |||||
| To run Ansible in a (Docker) container on the Matrix server itself, you need to have a working Docker installation. | To run Ansible in a (Docker) container on the Matrix server itself, you need to have a working Docker installation. | ||||
| Docker is normally installed by the playbook, so this may be a bit of a chicken and egg problem. To solve it: | Docker is normally installed by the playbook, so this may be a bit of a chicken and egg problem. To solve it: | ||||
| - you **either** need to install Docker manually first. Follow [the upstream instructions](https://docs.docker.com/engine/install/) for your distribution and consider setting `matrix_docker_installation_enabled: false` in your `vars.yml` file, to prevent the playbook from installing Docker | |||||
| - you **either** need to install Docker manually first. Follow [the upstream instructions](https://docs.docker.com/engine/install/) for your distribution and consider setting `matrix_playbook_docker_installation_enabled: false` in your `vars.yml` file, to prevent the playbook from installing Docker | |||||
| - **or** you need to run the playbook in another way (e.g. [Running Ansible in a container on another computer (not the Matrix server)](#running-ansible-in-a-container-on-another-computer-not-the-matrix-server)) at least the first time around | - **or** you need to run the playbook in another way (e.g. [Running Ansible in a container on another computer (not the Matrix server)](#running-ansible-in-a-container-on-another-computer-not-the-matrix-server)) at least the first time around | ||||
| Once you have a working Docker installation on the server, **clone the playbook** somewhere on the server and configure it as per usual (`inventory/hosts`, `inventory/host_vars/..`, etc.), as described in [configuring the playbook](configuring-playbook.md). | Once you have a working Docker installation on the server, **clone the playbook** somewhere on the server and configure it as per usual (`inventory/hosts`, `inventory/host_vars/..`, etc.), as described in [configuring the playbook](configuring-playbook.md). | ||||
| @@ -317,7 +317,7 @@ If you've installed [Jitsi](configuring-playbook-jitsi.md) (not installed by def | |||||
| Yes, we can stop installing Docker ourselves. Just use this in your `vars.yml` file: | Yes, we can stop installing Docker ourselves. Just use this in your `vars.yml` file: | ||||
| ```yaml | ```yaml | ||||
| matrix_docker_installation_enabled: true | |||||
| matrix_playbook_docker_installation_enabled: true | |||||
| ``` | ``` | ||||
| ### I run another webserver on the same server where I wish to install Matrix. What now? | ### I run another webserver on the same server where I wish to install Matrix. What now? | ||||
| @@ -9,6 +9,23 @@ | |||||
| # You can also override ANY variable (seen here or in any given role), | # You can also override ANY variable (seen here or in any given role), | ||||
| # by re-defining it in your own configuration file (`inventory/host_vars/matrix.<your-domain>`). | # by re-defining it in your own configuration file (`inventory/host_vars/matrix.<your-domain>`). | ||||
| ######################################################################## | |||||
| # # | |||||
| # Playbook # | |||||
| # # | |||||
| ######################################################################## | |||||
| # Controls whether to install Docker or not | |||||
| # Also see `devture_docker_sdk_for_python_installation_enabled`. | |||||
| matrix_playbook_docker_installation_enabled: true | |||||
| ######################################################################## | |||||
| # # | |||||
| # /Playbook # | |||||
| # # | |||||
| ######################################################################## | |||||
| ######################################################################## | ######################################################################## | ||||
| # # | # # | ||||
| @@ -11,6 +11,20 @@ | |||||
| - role: custom/matrix_playbook_migration | - role: custom/matrix_playbook_migration | ||||
| - when: matrix_playbook_docker_installation_enabled | bool | |||||
| role: galaxy/geerlingguy.docker | |||||
| vars: | |||||
| docker_install_compose: false | |||||
| tags: | |||||
| - setup-docker | |||||
| - setup-all | |||||
| - when: devture_docker_sdk_for_python_installation_enabled | bool | |||||
| role: galaxy/com.devture.ansible.role.docker_sdk_for_python | |||||
| tags: | |||||
| - setup-docker | |||||
| - setup-all | |||||
| - when: devture_timesync_installation_enabled | bool | - when: devture_timesync_installation_enabled | bool | ||||
| role: galaxy/com.devture.ansible.role.timesync | role: galaxy/com.devture.ansible.role.timesync | ||||
| tags: | tags: | ||||
| @@ -1,5 +1,11 @@ | |||||
| --- | --- | ||||
| - src: geerlingguy.docker | |||||
| version: 6.0.3 | |||||
| - src: git+https://github.com/devture/com.devture.ansible.role.docker_sdk_for_python.git | |||||
| version: 7047b40314c1020e97ed3f15b44876fa88faf874 | |||||
| - src: git+https://github.com/devture/com.devture.ansible.role.playbook_help.git | - src: git+https://github.com/devture/com.devture.ansible.role.playbook_help.git | ||||
| version: c1f40e82b4d6b072b6f0e885239322bdaaaf554f | version: c1f40e82b4d6b072b6f0e885239322bdaaaf554f | ||||
| @@ -253,14 +253,6 @@ matrix_well_known_matrix_server_enabled: true | |||||
| # See `matrix_homeserver_admin_contacts`, `matrix_homeserver_support_url`, etc. | # See `matrix_homeserver_admin_contacts`, `matrix_homeserver_support_url`, etc. | ||||
| matrix_well_known_matrix_support_enabled: false | matrix_well_known_matrix_support_enabled: false | ||||
| # Controls whether Docker is automatically installed. | |||||
| # If you change this to false you must install and update Docker manually. You also need to install the docker (https://pypi.org/project/docker/) Python package. | |||||
| matrix_docker_installation_enabled: true | |||||
| # Controls the Docker package that is installed. | |||||
| # Possible values are "docker-ce" (default) and "docker.io" (Debian). | |||||
| matrix_docker_package_name: docker-ce | |||||
| # Variables to Control which parts of our roles run. | # Variables to Control which parts of our roles run. | ||||
| run_postgres_import: true | run_postgres_import: true | ||||
| run_postgres_upgrade: true | run_postgres_upgrade: true | ||||
| @@ -14,12 +14,6 @@ | |||||
| - setup-all | - setup-all | ||||
| - common | - common | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/server_base/setup.yml" | |||||
| when: run_setup | bool | |||||
| tags: | |||||
| - setup-all | |||||
| - common | |||||
| # This needs to always run, because it populates `matrix_user_uid` and `matrix_user_gid`, | # This needs to always run, because it populates `matrix_user_uid` and `matrix_user_gid`, | ||||
| # which are required by many other roles. | # which are required by many other roles. | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_matrix_user.yml" | - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_matrix_user.yml" | ||||
| @@ -1,41 +0,0 @@ | |||||
| --- | |||||
| - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_redhat.yml" | |||||
| when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int < 8 | |||||
| - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_redhat8.yml" | |||||
| when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int > 7 and ansible_distribution_major_version | int < 30 | |||||
| - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_fedora.yml" | |||||
| when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int > 30 | |||||
| - when: ansible_os_family == 'Debian' | |||||
| block: | |||||
| # ansible_lsb is only available if lsb-release is installed. | |||||
| - name: Ensure lsb-release installed | |||||
| ansible.builtin.apt: | |||||
| name: | |||||
| - lsb-release | |||||
| state: present | |||||
| update_cache: true | |||||
| register: lsb_release_installation_result | |||||
| - name: Reread ansible_lsb facts if lsb-release got installed | |||||
| ansible.builtin.setup: | |||||
| filter: ansible_lsb* | |||||
| when: lsb_release_installation_result.changed | |||||
| - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_debian.yml" | |||||
| when: (ansible_os_family == 'Debian') and (ansible_lsb.id != 'Raspbian') | |||||
| - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_raspbian.yml" | |||||
| when: (ansible_os_family == 'Debian') and (ansible_lsb.id == 'Raspbian') | |||||
| - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_archlinux.yml" | |||||
| when: ansible_distribution == 'Archlinux' | |||||
| - name: Ensure Docker is started and autoruns | |||||
| ansible.builtin.service: | |||||
| name: docker | |||||
| state: started | |||||
| enabled: true | |||||
| @@ -1,16 +0,0 @@ | |||||
| --- | |||||
| - name: Install host dependencies | |||||
| community.general.pacman: | |||||
| name: | |||||
| - python-docker | |||||
| - python-dnspython | |||||
| state: present | |||||
| update_cache: true | |||||
| - name: Ensure Docker is installed | |||||
| community.general.pacman: | |||||
| name: | |||||
| - docker | |||||
| state: present | |||||
| when: matrix_docker_installation_enabled | bool | |||||
| @@ -1,34 +0,0 @@ | |||||
| --- | |||||
| - name: Ensure APT usage dependencies are installed | |||||
| ansible.builtin.apt: | |||||
| name: | |||||
| - apt-transport-https | |||||
| - ca-certificates | |||||
| - gnupg | |||||
| state: present | |||||
| update_cache: true | |||||
| - name: Ensure Docker's APT key is trusted | |||||
| ansible.builtin.apt_key: | |||||
| url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg" | |||||
| id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 | |||||
| state: present | |||||
| register: add_repository_key | |||||
| ignore_errors: true | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure Docker repository is enabled | |||||
| ansible.builtin.apt_repository: | |||||
| repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable" | |||||
| state: present | |||||
| update_cache: true | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure Docker is installed | |||||
| ansible.builtin.apt: | |||||
| name: | |||||
| - "{{ matrix_docker_package_name }}" | |||||
| - "python{{ '3' if ansible_python.version.major == 3 else '' }}-docker" | |||||
| state: present | |||||
| when: matrix_docker_installation_enabled | bool | |||||
| @@ -1,32 +0,0 @@ | |||||
| --- | |||||
| - name: Ensure Docker repository is enabled | |||||
| ansible.builtin.template: | |||||
| src: "{{ role_path }}/files/yum.repos.d/{{ item }}" | |||||
| dest: "/etc/yum.repos.d/docker-ce.repo" | |||||
| owner: "root" | |||||
| group: "root" | |||||
| mode: 0644 | |||||
| with_items: | |||||
| - docker-ce-fedora.repo | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure Docker's RPM key is trusted | |||||
| ansible.builtin.rpm_key: | |||||
| state: present | |||||
| key: https://download.docker.com/linux/fedora/gpg | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure Docker is installed | |||||
| ansible.builtin.yum: | |||||
| name: | |||||
| - "{{ matrix_docker_package_name }}" | |||||
| - python3-pip | |||||
| state: present | |||||
| when: matrix_docker_installation_enabled | bool | |||||
| - name: Ensure Docker-Py is installed | |||||
| ansible.builtin.pip: | |||||
| name: docker-py | |||||
| state: present | |||||
| when: matrix_docker_installation_enabled | bool | |||||
| @@ -1,34 +0,0 @@ | |||||
| --- | |||||
| - name: Ensure APT usage dependencies are installed | |||||
| ansible.builtin.apt: | |||||
| name: | |||||
| - apt-transport-https | |||||
| - ca-certificates | |||||
| - gnupg | |||||
| state: present | |||||
| update_cache: true | |||||
| - name: Ensure Docker's APT key is trusted | |||||
| ansible.builtin.apt_key: | |||||
| url: https://download.docker.com/linux/raspbian/gpg | |||||
| id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 | |||||
| state: present | |||||
| register: add_repository_key | |||||
| ignore_errors: true | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure Docker repository is enabled | |||||
| ansible.builtin.apt_repository: | |||||
| repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable" | |||||
| state: present | |||||
| update_cache: true | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure Docker is installed | |||||
| ansible.builtin.apt: | |||||
| name: | |||||
| - "{{ matrix_docker_package_name }}" | |||||
| - "python{{ '3' if ansible_python.version.major == 3 else '' }}-docker" | |||||
| state: present | |||||
| when: matrix_docker_installation_enabled | bool | |||||
| @@ -1,24 +0,0 @@ | |||||
| --- | |||||
| - name: Ensure Docker repository is enabled | |||||
| ansible.builtin.template: | |||||
| src: "{{ role_path }}/files/yum.repos.d/docker-ce-centos.repo" | |||||
| dest: "/etc/yum.repos.d/docker-ce.repo" | |||||
| owner: "root" | |||||
| group: "root" | |||||
| mode: 0644 | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure Docker's RPM key is trusted | |||||
| ansible.builtin.rpm_key: | |||||
| state: present | |||||
| key: https://download.docker.com/linux/centos/gpg | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure Docker is installed | |||||
| ansible.builtin.yum: | |||||
| name: | |||||
| - "{{ matrix_docker_package_name }}" | |||||
| - docker-python | |||||
| state: present | |||||
| when: matrix_docker_installation_enabled | bool | |||||
| @@ -1,37 +0,0 @@ | |||||
| --- | |||||
| - name: Ensure Docker repository is enabled | |||||
| ansible.builtin.template: | |||||
| src: "{{ role_path }}/files/yum.repos.d/docker-ce-centos.repo" | |||||
| dest: "/etc/yum.repos.d/docker-ce.repo" | |||||
| owner: "root" | |||||
| group: "root" | |||||
| mode: 0644 | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure Docker's RPM key is trusted | |||||
| ansible.builtin.rpm_key: | |||||
| state: present | |||||
| key: https://download.docker.com/linux/centos/gpg | |||||
| when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' | |||||
| - name: Ensure EPEL is installed | |||||
| ansible.builtin.yum: | |||||
| name: | |||||
| - epel-release | |||||
| state: present | |||||
| update_cache: true | |||||
| - name: Ensure Docker is installed | |||||
| ansible.builtin.yum: | |||||
| name: | |||||
| - "{{ matrix_docker_package_name }}" | |||||
| - python3-pip | |||||
| state: present | |||||
| when: matrix_docker_installation_enabled | bool | |||||
| - name: Ensure Docker-Py is installed | |||||
| ansible.builtin.pip: | |||||
| name: docker-py | |||||
| state: present | |||||
| when: matrix_docker_installation_enabled | bool | |||||
| @@ -27,3 +27,6 @@ | |||||
| - {'old': 'matrix_nginx_proxy_synapse_cache_path', 'new': 'matrix_synapse_reverse_proxy_companion_synapse_cache_path'} | - {'old': 'matrix_nginx_proxy_synapse_cache_path', 'new': 'matrix_synapse_reverse_proxy_companion_synapse_cache_path'} | ||||
| - {'old': 'matrix_nginx_proxy_synapse_cache_enabled', 'new': 'matrix_synapse_reverse_proxy_companion_synapse_cache_enabled'} | - {'old': 'matrix_nginx_proxy_synapse_cache_enabled', 'new': 'matrix_synapse_reverse_proxy_companion_synapse_cache_enabled'} | ||||
| - {'old': 'matrix_docker_installation_enabled', 'new': 'matrix_playbook_docker_installation_enabled'} | |||||
| - {'old': 'matrix_docker_package_name', 'new': '<Not applicable. Docker is installed using https://github.com/geerlingguy/ansible-role-docker now>'} | |||||