Commit graph

67 commits

Author SHA1 Message Date
Sebastian Gumprich 48388a3d96 use fqcns for some task
Signed-off-by: Sebastian Gumprich <github@gumpri.ch>
2022-10-28 14:04:29 +02:00
Slavi Pantaleev 1ea1597020 Fix some ansible-lint-reported warnings
This mostly fixes `key-order` warnings around
`block` statements.
2022-09-27 11:38:33 +03:00
Shaleen Jain f674afe5e8
appservice: add and use homeserver_container_* vars (#2045)
* appservice: add and use matrix_homeserver_* vars

* appservice: use the new vars

* Apply suggestions from code review

Co-authored-by: Slavi Pantaleev <slavi@devture.com>

Co-authored-by: Slavi Pantaleev <slavi@devture.com>
2022-08-24 08:38:12 +03:00
Cody Wyatt Neiman 1dea35209b
Fix self-build error image names 2022-07-19 19:46:45 -04:00
Slavi Pantaleev 7831dc91b3 Import tasks from other roles in a better way
One that doesn't trip up ansible-lint, causing `load-failure` errors.
2022-07-18 16:15:04 +03:00
Slavi Pantaleev d073c7ecb3 More ansible-lint fixes 2022-07-18 13:01:19 +03:00
Slavi Pantaleev ddf18eadc7 More ansible-lint fixes 2022-07-18 13:01:17 +03:00
Slavi Pantaleev 34cdaade08 Use fully-qualified module names for builtin Ansible modules
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/1939
2022-07-18 12:58:41 +03:00
Aine e149f33140
add/unify 'Project source code URL' link across all roles 2022-07-16 23:59:21 +03:00
Aine 5801017df0
mx-puppet-bridges - set log level = warn, set presence interval = 5s 2022-06-26 20:16:09 +03:00
Slavi Pantaleev 677a2fc503 Fix compatibility with ansible=6 / ansible-core=2.13
Details here: https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_6.html#id36

Basically:

```yaml
- name: Prior to 2.13
  debug:
    msg: '[1] + {{ [2] }}'

- name: 2.13 and forward
  debug:
    msg: '{{ [1] + [2] }}'
```

Interestingly, we had been using the new/safe syntax in lofs of places.

We were using the broken one in many others though. Hopefully all
instances were fixed by this patch.
2022-05-18 15:43:39 +03:00
Slavi Pantaleev f21269f441
Upgrade mx-puppet-slack (v0.1.1 -> v0.1.2)
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1829
2022-05-16 21:40:31 +03:00
Daniel Sonck 894669eca2 Change back to working original mx-puppet-slack
Now that v0.1.1 is out, which depends on the functional matrix-slack-parser
it works again.
2022-05-14 21:09:54 +02:00
Slavi Pantaleev 9fc60d8c86 Revert "Change back to original mx-puppet-slack"
This reverts commit fcfd00bcb4.

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1808

Reverts https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/1809

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1810
2022-05-10 16:20:44 +03:00
Daniel Sonck fcfd00bcb4 Change back to original mx-puppet-slack
Closes: #1808
2022-05-09 23:38:01 +02:00
Slavi Pantaleev 2df993977a Ensure git cloning when self-building is done with the matrix user, not root
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1749
2022-04-14 08:52:37 +03:00
Slavi Pantaleev 0364c6c634 Suppress old container cleanup (kill/rm) failures
People often report and ask about these "failures".
More-so previously, when the `docker kill/rm` output was collected,
but it still happens now when people do `systemctl status
matrix-something` and notice that it says "FAILURE".

Suppressing to avoid further time being wasted on saying "this is
expected".
2022-04-11 09:05:33 +03:00
Slavi Pantaleev 999c717cf4 Revert "Temporarily switch to Myned-maintained fork of mx-puppet-discord/mx-puppet-slack"
This reverts commit 0103d92df4.

The same fix has now been merged upstream
(https://gitlab.com/beeper/mx-puppet-monorepo/-/merge_requests/35), so
we don't need to use a fork anymore.

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1719
2022-03-31 08:37:24 +03:00
Slavi Pantaleev 0103d92df4 Temporarily switch to Myned-maintained fork of mx-puppet-discord/mx-puppet-slack
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1719

We're using a pinned commit of this fork, which patches up the npm/yarn
lock files, so that self-building of the Discord and Slack bridges can
work after GitHub's deprecation of the `git://` and `ssh://` protocols
(https://github.blog/2021-09-01-improving-git-protocol-security-github/).

When the issue gets fixed in the Beeper fork (via
https://gitlab.com/beeper/mx-puppet-monorepo/-/merge_requests/35 or
otherwise), we'll get back on it.
2022-03-30 09:02:17 +03:00
Aine 95cfbf0256
Switch mx-puppet-slack to the beeper fork (#1704) 2022-03-17 22:16:17 +02:00
Aine 2da3768b20
Added retries to the docker pulls (#1701) 2022-03-17 17:37:11 +02:00
Jim Myhrberg eeca3c8dca
fix: avoid yaml being wrapped at column 80 via to_nice_yaml
The `to_nice_yaml` helper will by default wrap any string YAML values on
the first space after column 80. This can in worst case yield invalid
YAML syntax. More details in Ansible's documentation here:

https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#formatting-data-yaml-and-json

In short, you need to explicitly provide a custom width argument of a
high number of some kind to avoid the line wrapping.
2022-03-16 01:10:26 +00:00
László Várady 9cc3c5be76 Fix warning about reverse-proxying when built-in proxy is disabled
`matrix_nginx_proxy_enabled` is usually set to false by users, this is when
the warning should be displayed.
2022-03-12 16:29:20 +01:00
Marko Weltzer 819574b8ba
Merge branch 'spantaleev:master' into master 2022-02-05 21:37:53 +01:00
Marko Weltzer 7e5b88c3b7 fix: all praise the allmighty yamllinter 2022-02-05 21:32:54 +01:00
Slavi Pantaleev 86c36523df Replace ExecStopPost with ExecStop
Reverts b1b4ba501f, 90c9801c56, a3c84f78ca, ..

I haven't really traced it (yet), but on some servers, I'm observing
`ansible-playbook ... --tags=start` completing very slowly, waiting
to stop services. I can't reproduce this on all Matrix servers I manage.
I suspect that either the systemd version is to blame or that some
specific service is not responding well to some `docker kill/rm` command.

`ExecStop` seems to work great in all cases and it's what we've been
using for a very long time, so I'm reverting to that.
2022-02-05 12:13:36 +02:00
Slavi Pantaleev fce190099a
Use |to_json for matrix_mx_puppet_slack_oauth_client_secret 2022-01-28 08:15:23 +02:00
Jim Myhrberg 7ae70c27e6
feat(mx-puppet-slack): add support for OAuth client ID/secret
The OAuth credentials method seems to be the only viable way to
configure the mx-puppet-bridge now. Legacy tokens can no longer be
created, and the other methods (xoxs and xoxc tokens) come with warnings
about them being against Slack's terms of service.
2022-01-28 01:22:34 +00:00
Slavi Pantaleev b1b4ba501f Replace ExecStop with ExecStopPost
ExecStopPost should allow us to clean up (docker kill + docker rm)
even if the ExecStart (docker run ..) command failed, and not just after
a graceful service stop was initiated.

Source: https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStopPost=
2022-01-04 17:27:25 +02:00
HarHarLinks c0f7c39f7d s/plabook/playbook 2022-01-03 18:34:21 +01:00
Slavi Pantaleev 735c966ab6 Disable systemd services when stopping to uninstall them
Until now, we were leaving services "enabled"
(symlinks in /etc/systemd/system/multi-user.target.wants/).

We clean these up now. Broken symlinks may still exist in older
installations that enabled/disabled services. We're not taking care
to fix these up. It's just a cosmetic defect anyway.
2021-11-10 17:39:21 +02:00
Aaron Raimist fc16fbda5b
Remove a bunch of redundant Ansible <2.8 self building checks 2021-07-02 00:14:37 -05:00
Marcel Ackermann a790096adf
matrix_mx_puppet_slack_client_id deprecated 2021-06-21 12:13:20 +02:00
Marcel Ackermann ed078998b5
deprecated 2021-06-21 12:12:07 +02:00
Slavi Pantaleev fa76c1ee5b Do not run self-build Ansible version-check, if component not enabled
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/1108
2021-06-08 08:59:02 +03:00
Aaron Raimist 04548f8df2
Merge branch 'master' into hydrogen 2021-05-21 04:09:18 -05:00
Slavi Pantaleev 47b4608b96 Fail in a friendlier way when trying to self-build on Ansible <= 2.8
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070

Related discussion here: 1ab507349c (commitcomment-51108407)
2021-05-21 11:15:05 +03:00
Slavi Pantaleev 1ab507349c Fix self-building for various components on Ansible < 2.8
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070
2021-05-20 08:43:20 +03:00
Aaron Raimist ca361af616
Add Hydrogen 2021-05-15 04:23:36 -05:00
Ahmad Haghighi e335f3fc77 rename matrix_global_registry to matrix_container_global_registry_prefix related to #990
Signed-off-by: Ahmad Haghighi <haghighi@fedoraproject.org>
2021-04-12 17:23:55 +04:30
Ahmad Haghighi f52a8b6484 use custom docker registry 2021-04-12 17:23:55 +04:30
transcaffeine dbae18fd6a
feat: push ephemeral events to appservices
This adds https://github.com/matrix-org/matrix-doc/pull/2409 to the
appservice registrations, enabling synapse to push EDUs to appservices.
2021-03-25 18:49:54 +01:00
rakshazi 2f887f292c
added "matrix_%SERVICE%_version" variable to all roles, use it in "matrix_%SERVICE%_docker_image" var (preserving backward-compatibility) 2021-02-20 19:08:28 +02:00
Slavi Pantaleev d98a1ceadd Merge branch 'master' into synapse-workers 2021-01-27 10:27:17 +02:00
Slavi Pantaleev 512f42aa76 Do not report docker kill/rm attempts as errors
These are just defensive cleanup tasks that we run.
In the good case, there's nothing to kill or remove, so they trigger an
error like this:

> Error response from daemon: Cannot kill container: something: No such container: something

and:

> Error: No such container: something

People often ask us if this is a problem, so instead of always having to
answer with "no, this is to be expected", we'd rather eliminate it now
and make logs cleaner.

In the event that:
- a container is really stuck and needs cleanup using kill/rm
- and cleanup fails, and we fail to report it because of error
suppression (`2>/dev/null`)

.. we'd still get an error when launching ("container name already in use .."),
so it shouldn't be too hard to investigate.
2021-01-27 10:22:46 +02:00
Slavi Pantaleev d3ecc6f017 Fix bridges failing to upload media when Synapse workers are enabled 2021-01-25 13:55:08 +02:00
Slavi Pantaleev 2997a7fc3e Make mx-puppet-* bridges not log to files
We log everything in systemd/journald for every service already,
so there's no need for double-logging, bridges rotating log files
manually and other such nonsense.
2021-01-22 19:22:26 +02:00
Slavi Pantaleev 1692a28fe4 Work around annoying Docker warning about undefined $HOME
> WARNING: Error loading config file: .dockercfg: $HOME is not defined

.. which appeared in Docker 20.10.
2021-01-15 00:23:01 +02:00
Slavi Pantaleev 05ca9357a8 Add .service suffix to systemd units list
We'll be adding `.timer` units later on, so it's good to be
more explicit.
2021-01-14 23:02:10 +02:00
Stuart Mumford 019a4d7dcd Use role relative paths for things 2020-12-23 11:34:48 +00:00