Rename file names and references to those files

Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
This commit is contained in:
Suguru Hirahara 2024-10-29 00:56:36 +09:00
parent 829858a3f5
commit 8c5bb6a4ad
No known key found for this signature in database
GPG Key ID: E4F9743DAB4B7B75
12 changed files with 31 additions and 31 deletions

View File

@ -1316,7 +1316,7 @@ Recently, a few large optimizations have been done to this playbook and its exte
1. Replacing Ansible `import_tasks` calls with `include_tasks`, which decreased runtime in half. Using `import_tasks` is slower and causes Ansible to go through and skip way too many tasks (tasks which could have been skipped altogether by not having Ansible include them in the first place). On an experimental VM, **deployment time was decreased from ~530 seconds to ~250 seconds**.
2. Introducing new `install-*` tags (`install-all` and `install-COMPONENT`, e.g. `install-synapse`, `install-bot-postmoogle`), which only run Ansible tasks pertaining to installation, while skipping uninstallation tasks. In most cases, people are maintaining the same setup or they're *adding* new components. Removing components is rare. Running thousands of uninstallation tasks each time is wasteful. On an experimental VM, **deployment time was decreased from ~250 seconds (`--tags=setup-all`) to ~100 seconds (`--tags=install-all`)**.
2. Introducing new `install-*` tags (`install-all` and `install-COMPONENT`, e.g. `install-synapse`, `install-postmoogle`), which only run Ansible tasks pertaining to installation, while skipping uninstallation tasks. In most cases, people are maintaining the same setup or they're *adding* new components. Removing components is rare. Running thousands of uninstallation tasks each time is wasteful. On an experimental VM, **deployment time was decreased from ~250 seconds (`--tags=setup-all`) to ~100 seconds (`--tags=install-all`)**.
You can still use `--tags=setup-all`. In fact, that's the best way to ensure your server is reconciled with the `vars.yml` configuration.

View File

@ -74,7 +74,7 @@ You can also refer to the upstream [documentation](https://github.com/etkecc/pos
### Debug/Logs
As with all other services, you can find their logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by running something like `journalctl -fu matrix-bot-postmoogle`
As with all other services, you can find their logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by running something like `journalctl -fu matrix-postmoogle`
The default logging level for this bridge is `INFO`, but you can increase it to `DEBUG` with the following additional configuration:

View File

@ -19,9 +19,9 @@ Here are some playbook tags that you should be familiar with:
- `install-all` - like `setup-all`, but skips uninstallation tasks. Useful for maintaining your setup quickly when its components remain unchanged. If you adjust your `vars.yml` to remove components, you'd need to run `setup-all` though, or these components will still remain installed
- `setup-SERVICE` (e.g. `setup-bot-postmoogle`) - runs the setup tasks only for a given role, but does not start/restart services. You can discover these additional tags in each role (`roles/**/tasks/main.yml`). Running per-component setup tasks is **not recommended**, as components sometimes depend on each other and running just the setup tasks for a given component may not be enough. For example, setting up the [mautrix-telegram bridge](configuring-playbook-bridge-mautrix-telegram.md), in addition to the `setup-mautrix-telegram` tag, requires database changes (the `setup-postgres` tag) as well as reverse-proxy changes (the `setup-nginx-proxy` tag).
- `setup-SERVICE` (e.g. `setup-postmoogle`) - runs the setup tasks only for a given role, but does not start/restart services. You can discover these additional tags in each role (`roles/**/tasks/main.yml`). Running per-component setup tasks is **not recommended**, as components sometimes depend on each other and running just the setup tasks for a given component may not be enough. For example, setting up the [mautrix-telegram bridge](configuring-playbook-bridge-mautrix-telegram.md), in addition to the `setup-mautrix-telegram` tag, requires database changes (the `setup-postgres` tag) as well as reverse-proxy changes (the `setup-nginx-proxy` tag).
- `install-SERVICE` (e.g. `install-bot-postmoogle`) - like `setup-SERVICE`, but skips uninstallation tasks. See `install-all` above for additional information.
- `install-SERVICE` (e.g. `install-postmoogle`) - like `setup-SERVICE`, but skips uninstallation tasks. See `install-all` above for additional information.
- `start` - starts all systemd services and makes them start automatically in the future

View File

@ -293,8 +293,6 @@ devture_systemd_service_manager_services_list_auto: |
+
([{'name': 'matrix-bot-draupnir.service', 'priority': 4000, 'groups': ['matrix', 'bots', 'draupnir', 'bot-draupnir']}] if matrix_bot_draupnir_enabled else [])
+
([{'name': 'matrix-bot-postmoogle.service', 'priority': 2200, 'groups': ['matrix', 'bots', 'postmoogle', 'bot-postmoogle']}] if matrix_postmoogle_enabled else [])
+
([{'name': 'matrix-bot-chatgpt.service', 'priority': 2200, 'groups': ['matrix', 'bots', 'chatgpt', 'bot-chatgpt']}] if matrix_bot_chatgpt_enabled else [])
+
([{'name': 'matrix-appservice-discord.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'appservice-discord']}] if matrix_appservice_discord_enabled else [])
@ -365,6 +363,8 @@ devture_systemd_service_manager_services_list_auto: |
+
([{'name': 'matrix-mx-puppet-twitter.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mx-puppet-twitter']}] if matrix_mx_puppet_twitter_enabled else [])
+
([{'name': 'matrix-postmoogle.service', 'priority': 2200, 'groups': ['matrix', 'bridges', 'postmoogle']}] if matrix_postmoogle_enabled else [])
+
([{'name': 'matrix-sms-bridge.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'sms']}] if matrix_sms_bridge_enabled else [])
+
([{'name': 'matrix-cactus-comments.service', 'priority': 2000, 'groups': ['matrix', 'cactus-comments']}] if matrix_cactus_comments_enabled else [])
@ -2858,7 +2858,7 @@ matrix_bot_baibot_container_additional_networks_auto: |-
######################################################################
#
# matrix-bot-postmoogle
# matrix-postmoogle
#
######################################################################
@ -2928,7 +2928,7 @@ matrix_postmoogle_container_additional_networks_auto: |-
######################################################################
#
# /matrix-bot-postmoogle
# /matrix-postmoogle
#
######################################################################

View File

@ -28,13 +28,13 @@ matrix_postmoogle_container_additional_networks_custom: []
# A list of extra arguments to pass to the container
matrix_postmoogle_container_extra_arguments: []
# List of systemd services that matrix-bot-postmoogle.service depends on
# List of systemd services that matrix-postmoogle.service depends on
matrix_postmoogle_systemd_required_services_list: "{{ matrix_postmoogle_systemd_required_services_list_default + matrix_postmoogle_systemd_required_services_list_auto + matrix_postmoogle_systemd_required_services_list_custom }}"
matrix_postmoogle_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
matrix_postmoogle_systemd_required_services_list_auto: []
matrix_postmoogle_systemd_required_services_list_custom: []
# List of systemd services that matrix-bot-postmoogle.service wants
# List of systemd services that matrix-postmoogle.service wants
matrix_postmoogle_systemd_wanted_services_list: []
# Database-related configuration fields.

View File

@ -2,9 +2,9 @@
- tags:
- setup-all
- setup-bot-postmoogle
- setup-postmoogle
- install-all
- install-bot-postmoogle
- install-postmoogle
block:
- when: matrix_postmoogle_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
@ -14,7 +14,7 @@
- tags:
- setup-all
- setup-bot-postmoogle
- setup-postmoogle
block:
- when: not matrix_postmoogle_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"

View File

@ -18,7 +18,7 @@
caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_postmoogle_database_engine'
engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-bot-postmoogle.service']
systemd_services_to_stop: ['matrix-postmoogle.service']
- ansible.builtin.set_fact:
matrix_postmoogle_requires_restart: true
@ -86,9 +86,9 @@
driver: bridge
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
- name: Ensure matrix-bot-postmoogle.service installed
- name: Ensure matrix-postmoogle.service installed
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-bot-postmoogle.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service"
src: "{{ role_path }}/templates/systemd/matrix-postmoogle.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-postmoogle.service"
mode: 0644
register: matrix_postmoogle_systemd_service_result

View File

@ -2,21 +2,21 @@
- name: Check existence of matrix-postmoogle service
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service"
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-postmoogle.service"
register: matrix_postmoogle_service_stat
- when: matrix_postmoogle_service_stat.stat.exists | bool
block:
- name: Ensure matrix-postmoogle is stopped
ansible.builtin.service:
name: matrix-bot-postmoogle
name: matrix-postmoogle
state: stopped
enabled: false
daemon_reload: true
- name: Ensure matrix-bot-postmoogle.service doesn't exist
- name: Ensure matrix-postmoogle.service doesn't exist
ansible.builtin.file:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service"
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-postmoogle.service"
state: absent
- name: Ensure Matrix postmoogle paths don't exist

View File

@ -1,6 +1,6 @@
#jinja2: lstrip_blocks: "True"
[Unit]
Description=Matrix Postmoogle bot
Description=Matrix Postmoogle bridge
{% for service in matrix_postmoogle_systemd_required_services_list %}
Requires={{ service }}
After={{ service }}
@ -13,12 +13,12 @@ DefaultDependencies=no
[Service]
Type=simple
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-bot-postmoogle 2>/dev/null || true'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bot-postmoogle 2>/dev/null || true'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-postmoogle 2>/dev/null || true'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-postmoogle 2>/dev/null || true'
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--rm \
--name=matrix-bot-postmoogle \
--name=matrix-postmoogle \
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
@ -39,16 +39,16 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
{{ matrix_postmoogle_docker_image }}
{% for network in matrix_postmoogle_container_additional_networks %}
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-postmoogle
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-postmoogle
{% endfor %}
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-postmoogle
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-postmoogle
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-bot-postmoogle 2>/dev/null || true'
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bot-postmoogle 2>/dev/null || true'
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-postmoogle 2>/dev/null || true'
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-postmoogle 2>/dev/null || true'
Restart=always
RestartSec=30
SyslogIdentifier=matrix-bot-postmoogle
SyslogIdentifier=matrix-postmoogle
[Install]
WantedBy=multi-user.target

View File

@ -82,6 +82,7 @@
- custom/matrix-bridge-mx-puppet-slack
- custom/matrix-bridge-mx-puppet-twitter
- custom/matrix-bridge-mx-puppet-instagram
- custom/matrix-bridge-postmoogle
- custom/matrix-bridge-sms
- custom/matrix-bridge-heisenbridge
- custom/matrix-bridge-hookshot
@ -91,7 +92,6 @@
- custom/matrix-bot-buscarron
- custom/matrix-bot-baibot
- custom/matrix-bot-honoroit
- custom/matrix-bot-postmoogle
- custom/matrix-bot-go-neb
- custom/matrix-bot-mjolnir
- custom/matrix-bot-draupnir