| @@ -342,7 +342,7 @@ As described in [How is the effective configuration determined?](#how-is-the-eff | |||||
| Refer to both of these for inspiration. Still, as mentioned in [Configuring the playbook](configuring-playbook.md), you're only ever supposed to edit your own `inventory/host_vars/matrix.DOMAIN/vars.yml` file and nothing else inside the playbook (unless you're meaning to contribute new features). | Refer to both of these for inspiration. Still, as mentioned in [Configuring the playbook](configuring-playbook.md), you're only ever supposed to edit your own `inventory/host_vars/matrix.DOMAIN/vars.yml` file and nothing else inside the playbook (unless you're meaning to contribute new features). | ||||
| **Note**: some of the roles (`roles/galaxy/*`) live in separate repositories and are only installed after your run `just roles` (or `make roles`). | |||||
| **Note**: some of the roles (`roles/galaxy/*`) live in separate repositories and are only installed after your run `just roles` or `just update` (or `make roles`). | |||||
| ### I'd like to adjust some configuration which doesn't have a corresponding variable. How do I do it? | ### I'd like to adjust some configuration which doesn't have a corresponding variable. How do I do it? | ||||
| @@ -356,7 +356,7 @@ Besides that, each role (component) aims to provide a `matrix_SOME_COMPONENT_con | |||||
| Check each role's `roles/*/*/defaults/main.yml` for the corresponding variable and an example for how use it. | Check each role's `roles/*/*/defaults/main.yml` for the corresponding variable and an example for how use it. | ||||
| **Note**: some of the roles (`roles/galaxy/*`) live in separate repositories and are only installed after your run `just roles` (or `make roles`). | |||||
| **Note**: some of the roles (`roles/galaxy/*`) live in separate repositories and are only installed after your run `just roles` or `just update` (or `make roles`). | |||||
| ## Installation | ## Installation | ||||
| @@ -2,7 +2,7 @@ | |||||
| If you've [configured your DNS](configuring-dns.md) and have [configured the playbook](configuring-playbook.md), you can start the installation procedure. | If you've [configured your DNS](configuring-dns.md) and have [configured the playbook](configuring-playbook.md), you can start the installation procedure. | ||||
| **Before installing** and each time you update the playbook in the future, you will need to update the Ansible roles in this playbook by running `just roles`. `just roles` is a shortcut (a `roles` target defined in [`justfile`](../justfile) and executed by the [`just`](https://github.com/casey/just) utility) which ultimately runs [ansible-galaxy](https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html) to download Ansible roles. If you don't have `just`, you can also manually run the `roles` commands seen in the `justfile`. | |||||
| **Before installing** and each time you update the playbook in the future, you will need to update the Ansible roles in this playbook by running `just roles` or `just update`. `just roles` is a shortcut (a `roles` target defined in [`justfile`](../justfile) and executed by the [`just`](https://github.com/casey/just) utility) which ultimately runs [agru](https://gitlab.com/etke.cc/tools/agru) or [ansible-galaxy](https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html) (depending on what is available in your system) to download Ansible roles. If you don't have `just`, you can also manually run the `roles` commands seen in the `justfile`. `just update` is a shortcut which updates the playbook itself and the roles at the same time. | |||||
| ## Playbook tags introduction | ## Playbook tags introduction | ||||
| @@ -6,11 +6,11 @@ If you want to be notified when new versions of Synapse are released, you should | |||||
| To upgrade services: | To upgrade services: | ||||
| - update your playbook directory (`git pull`), so you'd obtain everything new we've done | |||||
| - update your playbook directory using `just update` or`git pull`, so you'd obtain everything new we've done | |||||
| - take a look at [the changelog](../CHANGELOG.md) to see if there have been any backward-incompatible changes that you need to take care of | - take a look at [the changelog](../CHANGELOG.md) to see if there have been any backward-incompatible changes that you need to take care of | ||||
| - download the upstream Ansible roles used by the playbook by running `just roles` | |||||
| - download the upstream Ansible roles used by the playbook by running `just update` or `just roles` | |||||
| - re-run the [playbook setup](installing.md) and restart all services: `just setup-all` | - re-run the [playbook setup](installing.md) and restart all services: `just setup-all` | ||||
| @@ -26,7 +26,7 @@ If your distro runs within an [LXC container](https://linuxcontainers.org/), you | |||||
| - [`git`](https://git-scm.com/) is the recommended way to download the playbook to your computer. `git` may also be required on the server if you will be [self-building](self-building.md) components. | - [`git`](https://git-scm.com/) is the recommended way to download the playbook to your computer. `git` may also be required on the server if you will be [self-building](self-building.md) components. | ||||
| - [`just`](https://github.com/casey/just) for running `just roles`, etc. (see [`justfile`](../justfile)), although you can also run these commands manually | |||||
| - [`just`](https://github.com/casey/just) for running `just roles`, `just update`, etc. (see [`justfile`](../justfile)), although you can also run these commands manually | |||||
| - An HTTPS-capable web server at the base domain name (`<your-domain>`) which is capable of serving static files. Unless you decide to [Serve the base domain from the Matrix server](configuring-playbook-base-domain-serving.md) or alternatively, to use DNS SRV records for [Server Delegation](howto-server-delegation.md). | - An HTTPS-capable web server at the base domain name (`<your-domain>`) which is capable of serving static files. Unless you decide to [Serve the base domain from the Matrix server](configuring-playbook-base-domain-serving.md) or alternatively, to use DNS SRV records for [Server Delegation](howto-server-delegation.md). | ||||
| @@ -5,6 +5,7 @@ default: | |||||
| # Pulls external Ansible roles | # Pulls external Ansible roles | ||||
| roles: | roles: | ||||
| #!/usr/bin/env sh | #!/usr/bin/env sh | ||||
| echo "[NOTE] This command just updates the roles, but if you want to update everything at once (playbook, roles, etc.) - use 'just update'" | |||||
| if [ -x "$(command -v agru)" ]; then | if [ -x "$(command -v agru)" ]; then | ||||
| agru | agru | ||||
| else | else | ||||
| @@ -12,9 +13,25 @@ roles: | |||||
| ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force | ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force | ||||
| fi | fi | ||||
| # Updates requirements.yml if there are any new tags available. Requires agru | |||||
| update: | |||||
| @agru -u | |||||
| # Updates requirements.yml if there are any new tags available. Supported flags: -u (update roles, if any new tags are available) | |||||
| update *flags: #update-self | |||||
| #!/usr/bin/env sh | |||||
| if [ -x "$(command -v agru)" ]; then | |||||
| echo {{ if flags == "" { "installing roles..." } else if flags == "-u" { "updating roles..." } else { "unknown flag passed" } }} | |||||
| agru {{ flags }} | |||||
| else | |||||
| echo "[INFO] you are using standard ansible-galaxy to install roles, it's slow and cannot update roles if there are newer tags available. We recommend to install 'agru' tool to speed up the process: https://gitlab.com/etke.cc/tools/agru#where-to-get" | |||||
| echo "installing roles..." | |||||
| rm -rf roles/galaxy | |||||
| ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force | |||||
| fi | |||||
| # update playbook | |||||
| update-self: | |||||
| @echo "updating playbook..." | |||||
| @git stash -q | |||||
| @git pull -q | |||||
| @-git stash pop -q | |||||
| # Runs ansible-lint against all roles in the playbook | # Runs ansible-lint against all roles in the playbook | ||||
| lint: | lint: | ||||
| @@ -4,7 +4,7 @@ | |||||
| version: v1.0.0-3 | version: v1.0.0-3 | ||||
| name: auxiliary | name: auxiliary | ||||
| - src: git+https://gitlab.com/etke.cc/roles/backup_borg.git | - src: git+https://gitlab.com/etke.cc/roles/backup_borg.git | ||||
| version: v1.2.8-1.8.11-1 | |||||
| version: v1.2.8-1.8.13-0 | |||||
| name: backup_borg | name: backup_borg | ||||
| - src: git+https://github.com/devture/com.devture.ansible.role.container_socket_proxy.git | - src: git+https://github.com/devture/com.devture.ansible.role.container_socket_proxy.git | ||||
| version: v0.2.0-0 | version: v0.2.0-0 | ||||
| @@ -58,7 +58,7 @@ | |||||
| version: v0.14.0-5 | version: v0.14.0-5 | ||||
| name: prometheus_postgres_exporter | name: prometheus_postgres_exporter | ||||
| - src: git+https://gitlab.com/etke.cc/roles/redis.git | - src: git+https://gitlab.com/etke.cc/roles/redis.git | ||||
| version: v7.2.4-1 | |||||
| version: v7.2.4-2 | |||||
| name: redis | name: redis | ||||
| - src: git+https://github.com/devture/com.devture.ansible.role.systemd_docker_base.git | - src: git+https://github.com/devture/com.devture.ansible.role.systemd_docker_base.git | ||||
| version: v1.2.0-0 | version: v1.2.0-0 | ||||