* Fetch ansible-role-ddclient from MASH project
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Replace `matrix_dynamic_dns` with `ddclient`
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Set `matrix-dynamic-dns` to `ddclient_identifier`
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Remove `ddclient_container_network` in favor of the role's configuration
On the role the value of `ddclient_container_network` is set to `ddclient_identifier`, which is set to `matrix-dynamic-dns` on the playbook.
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Replace `matrix-dynamic-dns` with `ddclient` on matrix_servers
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Replace `ddclient_docker_image_*` with `ddclient_container_image_*`
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Update `ddclient_container_image_*`
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Move `ddclient_base_path` to matrix_servers
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Move `ddclient_web_*` to matrix_servers
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Remove `matrix-dynamic-dns` directory
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Update configuring-playbook-dynamic-dns.md
Reuse 75e264f538/docs/services/ddclient.md
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
* Fix a typo
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
---------
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
Co-authored-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
pull/4903/head
| @@ -1,5 +1,13 @@ | |||||
| # 2026-02-08 | # 2026-02-08 | ||||
| ## (BC Break) Dynamic DNS role has been relocated and variable names need adjustments | |||||
| The role for Dynamic DNS has been relocated to the [mother-of-all-self-hosting](https://github.com/mother-of-all-self-hosting) organization. | |||||
| Along with the relocation, the `matrix_dynamic_dns_` prefix on its variable names has been renamed to `ddclient_`, so you need to adjust your `vars.yml` configuration. | |||||
| As always, the playbook would let you know about this and point out any variables you may have missed. | |||||
| ## ma1sd has been removed from the playbook | ## ma1sd has been removed from the playbook | ||||
| [ma1sd](./docs/configuring-playbook-ma1sd.md) has been removed from the playbook, as it has been unmaintained for a long time. | [ma1sd](./docs/configuring-playbook-ma1sd.md) has been removed from the playbook, as it has been unmaintained for a long time. | ||||
| @@ -1,7 +1,20 @@ | |||||
| <!-- | <!-- | ||||
| SPDX-FileCopyrightText: 2020 Aaron Raimist | |||||
| SPDX-FileCopyrightText: 2020 Chris van Dijk | |||||
| SPDX-FileCopyrightText: 2020 Dominik Zajac | |||||
| SPDX-FileCopyrightText: 2020 Mickaël Cornière | |||||
| SPDX-FileCopyrightText: 2020 Scott Crossen | SPDX-FileCopyrightText: 2020 Scott Crossen | ||||
| SPDX-FileCopyrightText: 2020 Slavi Pantaleev | |||||
| SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara | |||||
| SPDX-FileCopyrightText: 2020-2024 MDAD project contributors | |||||
| SPDX-FileCopyrightText: 2020-2024 Slavi Pantaleev | |||||
| SPDX-FileCopyrightText: 2022 François Darveau | |||||
| SPDX-FileCopyrightText: 2022 Julian Foad | |||||
| SPDX-FileCopyrightText: 2022 Warren Bailey | |||||
| SPDX-FileCopyrightText: 2023 Antonis Christofides | |||||
| SPDX-FileCopyrightText: 2023 Felix Stupp | |||||
| SPDX-FileCopyrightText: 2023 Julian-Samuel Gebühr | |||||
| SPDX-FileCopyrightText: 2023 Pierre 'McFly' Marty | |||||
| SPDX-FileCopyrightText: 2024 Tiz | |||||
| SPDX-FileCopyrightText: 2024-2026 Suguru Hirahara | |||||
| SPDX-License-Identifier: AGPL-3.0-or-later | SPDX-License-Identifier: AGPL-3.0-or-later | ||||
| --> | --> | ||||
| @@ -12,6 +25,10 @@ The playbook can configure Dynamic DNS with [ddclient](https://github.com/ddc | |||||
| Most cloud providers / ISPs will charge you extra for a static IP address. If you're not hosting a highly reliable homeserver you can workaround this via dynamic DNS. | Most cloud providers / ISPs will charge you extra for a static IP address. If you're not hosting a highly reliable homeserver you can workaround this via dynamic DNS. | ||||
| For details about configuring the [Ansible role for ddclient](https://github.com/mother-of-all-self-hosting/ansible-role-ddclient), you can check them via: | |||||
| - 🌐 [the role's documentation](https://github.com/mother-of-all-self-hosting/ansible-role-ddclient/blob/main/docs/configuring-ddclient.md) online | |||||
| - 📁 `roles/galaxy/ddclient/docs/configuring-ddclient.md` locally, if you have [fetched the Ansible roles](../installing.md) | |||||
| ## Prerequisite | ## Prerequisite | ||||
| You'll need to authenticate with your DNS provider somehow, in most cases this is simply a username and password but can differ from provider to provider. Please consult with your providers documentation and the upstream [ddclient documentation](https://github.com/ddclient/ddclient/blob/main/ddclient.conf.in) to determine what you'll need to provide to authenticate. | You'll need to authenticate with your DNS provider somehow, in most cases this is simply a username and password but can differ from provider to provider. Please consult with your providers documentation and the upstream [ddclient documentation](https://github.com/ddclient/ddclient/blob/main/ddclient.conf.in) to determine what you'll need to provide to authenticate. | ||||
| @@ -21,17 +38,23 @@ You'll need to authenticate with your DNS provider somehow, in most cases this i | |||||
| To enable dynamic DNS, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: | To enable dynamic DNS, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: | ||||
| ```yaml | ```yaml | ||||
| matrix_dynamic_dns_enabled: true | |||||
| ddclient_enabled: true | |||||
| matrix_dynamic_dns_domain_configurations: | |||||
| ddclient_domain_configurations: | |||||
| - provider: example.net | - provider: example.net | ||||
| protocol: dyndn2 | |||||
| protocol: dyndns2 | |||||
| username: YOUR_USERNAME_HERE | username: YOUR_USERNAME_HERE | ||||
| password: YOUR_PASSWORD_HERE | password: YOUR_PASSWORD_HERE | ||||
| domain: "{{ matrix_domain }}" | domain: "{{ matrix_domain }}" | ||||
| ``` | ``` | ||||
| Keep in mind that certain providers may require a different configuration of the `matrix_dynamic_dns_domain_configurations` variable, for provider specific examples see the [upstream documentation](https://github.com/ddclient/ddclient/blob/main/ddclient.conf.in). | |||||
| Keep in mind that certain providers may require a different configuration of the `ddclient_domain_configurations` variable, for provider specific examples see the [upstream documentation](https://github.com/ddclient/ddclient/blob/main/ddclient.conf.in). | |||||
| ### Configuring the endpoint to obtain IP address (optional) | |||||
| The playbook sets the default endpoint for obtaining the IP address to `https://cloudflare.com/cdn-cgi/trace`. You can replace it by specifying yours to `ddclient_web` and `ddclient_web_skip` if necessary. | |||||
| Refer to [this section](https://github.com/mother-of-all-self-hosting/ansible-role-ddclient/blob/main/docs/configuring-ddclient.md#setting-the-endpoint-to-obtain-ip-address-optional) for more information. | |||||
| ### Extending the configuration | ### Extending the configuration | ||||
| @@ -39,7 +62,7 @@ There are some additional things you may wish to configure about the component. | |||||
| Take a look at: | Take a look at: | ||||
| - `roles/custom/matrix-dynamic-dns/defaults/main.yml` for some variables that you can customize via your `vars.yml` file | |||||
| - `roles/galaxy/ddclient/defaults/main.yml` for some variables that you can customize via your `vars.yml` file | |||||
| ## Installing | ## Installing | ||||
| @@ -63,4 +86,4 @@ Additional resources: | |||||
| ## Troubleshooting | ## Troubleshooting | ||||
| As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-dynamic-dns`. However, due to an [upstream issue](https://github.com/linuxserver/docker-ddclient/issues/54#issuecomment-1153143132) the logging output is not always complete. For advanced debugging purposes running the `ddclient` tool outside of the container is useful via the following: `ddclient -file ./ddclient.conf -daemon=0 -debug -verbose -noquiet`. | |||||
| See [this section](https://github.com/mother-of-all-self-hosting/ansible-role-ddclient/blob/main/docs/configuring-ddclient.md#troubleshooting) on the role's documentation for details. | |||||
| @@ -368,7 +368,7 @@ devture_systemd_service_manager_services_list_auto: | | |||||
| + | + | ||||
| ([{'name': 'matrix-dimension.service', 'priority': 4000, 'groups': ['matrix', 'integration-managers', 'dimension']}] if matrix_dimension_enabled else []) | ([{'name': 'matrix-dimension.service', 'priority': 4000, 'groups': ['matrix', 'integration-managers', 'dimension']}] if matrix_dimension_enabled else []) | ||||
| + | + | ||||
| ([{'name': 'matrix-dynamic-dns.service', 'priority': 5000, 'groups': ['matrix', 'dynamic-dns']}] if matrix_dynamic_dns_enabled else []) | |||||
| ([{'name': (ddclient_identifier + '.service'), 'priority': 5000, 'groups': ['matrix', 'ddclient', 'dynamic-dns']}] if ddclient_enabled else []) | |||||
| + | + | ||||
| ([{'name': (etherpad_identifier + '.service'), 'priority': 4000, 'groups': ['matrix', 'etherpad']}] if etherpad_enabled else []) | ([{'name': (etherpad_identifier + '.service'), 'priority': 4000, 'groups': ['matrix', 'etherpad']}] if etherpad_enabled else []) | ||||
| + | + | ||||
| @@ -3344,19 +3344,26 @@ etherpad_database_postgres_password: "{{ '%s' | format(matrix_homeserver_generic | |||||
| ###################################################################### | ###################################################################### | ||||
| # | # | ||||
| # matrix-dynamic-dns | |||||
| # ddclient | |||||
| # | # | ||||
| ###################################################################### | ###################################################################### | ||||
| matrix_dynamic_dns_enabled: false | |||||
| ddclient_enabled: false | |||||
| matrix_dynamic_dns_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_dynamic_dns_docker_image_registry_prefix_upstream_default }}" | |||||
| ddclient_identifier: matrix-dynamic-dns | |||||
| matrix_dynamic_dns_container_network: matrix-dynamic-dns | |||||
| ddclient_base_path: "{{ matrix_base_data_path }}/dynamic-dns" | |||||
| ddclient_container_image_registry_prefix: "{{ 'localhost/' if ddclient_container_image_self_build else ddclient_container_image_registry_prefix_upstream }}" | |||||
| ddclient_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else ddclient_docker_image_registry_prefix_upstream_default }}" | |||||
| ddclient_web: "https://cloudflare.com/cdn-cgi/trace" | |||||
| ddclient_web_skip: "ip=" | |||||
| ###################################################################### | ###################################################################### | ||||
| # | # | ||||
| # /matrix-dynamic-dns | |||||
| # /ddclient | |||||
| # | # | ||||
| ###################################################################### | ###################################################################### | ||||
| @@ -45,7 +45,7 @@ msgid "To enable dynamic DNS, add the following configuration to your `inventory | |||||
| msgstr "" | msgstr "" | ||||
| #: ../../../docs/configuring-playbook-dynamic-dns.md:34 | #: ../../../docs/configuring-playbook-dynamic-dns.md:34 | ||||
| msgid "Keep in mind that certain providers may require a different configuration of the `matrix_dynamic_dns_domain_configurations` variable, for provider specific examples see the [upstream documentation](https://github.com/ddclient/ddclient/blob/main/ddclient.conf.in)." | |||||
| msgid "Keep in mind that certain providers may require a different configuration of the `ddclient_domain_configurations` variable, for provider specific examples see the [upstream documentation](https://github.com/ddclient/ddclient/blob/main/ddclient.conf.in)." | |||||
| msgstr "" | msgstr "" | ||||
| #: ../../../docs/configuring-playbook-dynamic-dns.md:36 | #: ../../../docs/configuring-playbook-dynamic-dns.md:36 | ||||
| @@ -12,6 +12,10 @@ | |||||
| - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-container-socket-proxy.git | - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-container-socket-proxy.git | ||||
| version: v0.4.2-1 | version: v0.4.2-1 | ||||
| name: container_socket_proxy | name: container_socket_proxy | ||||
| - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-ddclient.git | |||||
| version: v4.0.0-0 | |||||
| name: ddclient | |||||
| activation_prefix: ddclient_ | |||||
| - src: git+https://github.com/geerlingguy/ansible-role-docker | - src: git+https://github.com/geerlingguy/ansible-role-docker | ||||
| version: 8.0.0 | version: 8.0.0 | ||||
| name: docker | name: docker | ||||
| @@ -1,79 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2020 - 2025 Slavi Pantaleev | |||||
| # SPDX-FileCopyrightText: 2020 Scott Crossen | |||||
| # SPDX-FileCopyrightText: 2021 - 2022 MDAD project contributors | |||||
| # SPDX-FileCopyrightText: 2021 Ahmad Haghighi | |||||
| # SPDX-FileCopyrightText: 2022 Marko Weltzer | |||||
| # SPDX-FileCopyrightText: 2022 Nikita Chernyi | |||||
| # SPDX-FileCopyrightText: 2023 Samuel Meenzen | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| # Project source code URL: https://github.com/linuxserver/docker-ddclient | |||||
| # Whether dynamic dns is enabled | |||||
| matrix_dynamic_dns_enabled: true | |||||
| # The dynamic dns daemon interval | |||||
| matrix_dynamic_dns_daemon_interval: '300' | |||||
| # renovate: datasource=docker depName=linuxserver/ddclient versioning=semver | |||||
| matrix_dynamic_dns_version: 4.0.0 | |||||
| # The docker container to use when in mode | |||||
| matrix_dynamic_dns_docker_image: "{{ matrix_dynamic_dns_docker_image_registry_prefix }}linuxserver/ddclient:{{ matrix_dynamic_dns_version }}" | |||||
| matrix_dynamic_dns_docker_image_registry_prefix: "{{ 'localhost/' if matrix_dynamic_dns_container_image_self_build else matrix_dynamic_dns_docker_image_registry_prefix_upstream }}" | |||||
| matrix_dynamic_dns_docker_image_registry_prefix_upstream: "{{ matrix_dynamic_dns_docker_image_registry_prefix_upstream_default }}" | |||||
| matrix_dynamic_dns_docker_image_registry_prefix_upstream_default: docker.io/ | |||||
| # The image to force pull | |||||
| matrix_dynamic_dns_docker_image_force_pull: "{{ matrix_dynamic_dns_docker_image.endswith(':latest') }}" | |||||
| matrix_dynamic_dns_container_network: '' | |||||
| matrix_dynamic_dns_container_additional_networks: "{{ matrix_dynamic_dns_container_additional_networks_auto + matrix_dynamic_dns_container_additional_networks_custom }}" | |||||
| matrix_dynamic_dns_container_additional_networks_auto: [] | |||||
| matrix_dynamic_dns_container_additional_networks_custom: [] | |||||
| # List of extra arguments to pass to the container mode | |||||
| matrix_dynamic_dns_container_extra_arguments: [] | |||||
| # List of wanted services when running in mode | |||||
| matrix_dynamic_dns_systemd_wanted_services_list: [] | |||||
| # List of required services when running in mode | |||||
| matrix_dynamic_dns_systemd_required_services_list: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" | |||||
| # Build the container from source when running in mode | |||||
| matrix_dynamic_dns_container_image_self_build: false | |||||
| matrix_dynamic_dns_container_image_self_build_repo: "https://github.com/linuxserver/docker-ddclient.git" | |||||
| matrix_dynamic_dns_container_image_self_build_repo_branch: "{{ matrix_dynamic_dns_version }}" | |||||
| # Config paths | |||||
| matrix_dynamic_dns_base_path: "{{ matrix_base_data_path }}/dynamic-dns" | |||||
| matrix_dynamic_dns_config_path: "{{ matrix_dynamic_dns_base_path }}/config" | |||||
| matrix_dynamic_dns_docker_src_files_path: "{{ matrix_dynamic_dns_base_path }}/docker-src" | |||||
| # Config options | |||||
| matrix_dynamic_dns_use: "web" | |||||
| # The endpoint to use to determine your external IP | |||||
| matrix_dynamic_dns_web: "https://cloudflare.com/cdn-cgi/trace" | |||||
| # The field to extract the IP from | |||||
| # If your endpoint defined in `matrix_dynamic_dns_web` doesn't need this, just set it to "" | |||||
| matrix_dynamic_dns_web_skip: "ip=" | |||||
| matrix_dynamic_dns_additional_configuration_blocks: [] | |||||
| # Holds the configurations (the domains to update DNS for, the providers they use, etc.) | |||||
| # | |||||
| # Example: | |||||
| # matrix_dynamic_dns_domain_configurations: | |||||
| # - provider: domains.google.com | |||||
| # protocol: dyndn2 | |||||
| # username: XXXXXXXXXXXXXXXX | |||||
| # password: XXXXXXXXXXXXXXXX | |||||
| # domain: "{{ matrix_domain }}" | |||||
| matrix_dynamic_dns_domain_configurations: [] | |||||
| @@ -1,26 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2020 Scott Crossen | |||||
| # SPDX-FileCopyrightText: 2022 - 2023 Slavi Pantaleev | |||||
| # SPDX-FileCopyrightText: 2022 Marko Weltzer | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| - tags: | |||||
| - setup-all | |||||
| - setup-dynamic-dns | |||||
| - install-all | |||||
| - install-dynamic-dns | |||||
| block: | |||||
| - when: matrix_dynamic_dns_enabled | bool | |||||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" | |||||
| - when: matrix_dynamic_dns_enabled | bool | |||||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" | |||||
| - tags: | |||||
| - setup-all | |||||
| - setup-dynamic-dns | |||||
| block: | |||||
| - when: not matrix_dynamic_dns_enabled | bool | |||||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" | |||||
| @@ -1,79 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev | |||||
| # SPDX-FileCopyrightText: 2020 Scott Crossen | |||||
| # SPDX-FileCopyrightText: 2022 Marko Weltzer | |||||
| # SPDX-FileCopyrightText: 2022 Nikita Chernyi | |||||
| # SPDX-FileCopyrightText: 2022 Sebastian Gumprich | |||||
| # SPDX-FileCopyrightText: 2024 David Mehren | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| - name: Ensure Dynamic DNS image is pulled | |||||
| community.docker.docker_image: | |||||
| name: "{{ matrix_dynamic_dns_docker_image }}" | |||||
| source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" | |||||
| force_source: "{{ matrix_dynamic_dns_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" | |||||
| force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_dynamic_dns_docker_image_force_pull }}" | |||||
| when: matrix_dynamic_dns_enabled | bool and not matrix_dynamic_dns_container_image_self_build | |||||
| register: result | |||||
| retries: "{{ devture_playbook_help_container_retries_count }}" | |||||
| delay: "{{ devture_playbook_help_container_retries_delay }}" | |||||
| until: result is not failed | |||||
| - name: Ensure Dynamic DNS paths exist | |||||
| ansible.builtin.file: | |||||
| path: "{{ item.path }}" | |||||
| state: directory | |||||
| mode: 0751 | |||||
| owner: "{{ matrix_user_name }}" | |||||
| group: "{{ matrix_group_name }}" | |||||
| with_items: | |||||
| - {path: "{{ matrix_dynamic_dns_base_path }}", when: true} | |||||
| - {path: "{{ matrix_dynamic_dns_config_path }}", when: true} | |||||
| - {path: "{{ matrix_dynamic_dns_docker_src_files_path }}", when: "{{ matrix_dynamic_dns_container_image_self_build }}"} | |||||
| when: matrix_dynamic_dns_enabled | bool and item.when | bool | |||||
| - name: Ensure Dynamic DNS repository is present on self build | |||||
| ansible.builtin.git: | |||||
| repo: "{{ matrix_dynamic_dns_container_image_self_build_repo }}" | |||||
| version: "{{ matrix_dynamic_dns_container_image_self_build_repo_branch }}" | |||||
| dest: "{{ matrix_dynamic_dns_docker_src_files_path }}" | |||||
| force: "yes" | |||||
| become: true | |||||
| become_user: "{{ matrix_user_name }}" | |||||
| register: matrix_dynamic_dns_git_pull_results | |||||
| when: "matrix_dynamic_dns_enabled | bool and matrix_dynamic_dns_container_image_self_build | bool" | |||||
| - name: Ensure Dynamic DNS Docker image is built | |||||
| community.docker.docker_image: | |||||
| name: "{{ matrix_dynamic_dns_docker_image }}" | |||||
| source: build | |||||
| force_source: "{{ matrix_dynamic_dns_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" | |||||
| force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_dynamic_dns_git_pull_results.changed }}" | |||||
| build: | |||||
| dockerfile: Dockerfile | |||||
| path: "{{ matrix_dynamic_dns_docker_src_files_path }}" | |||||
| pull: true | |||||
| when: "matrix_dynamic_dns_enabled | bool and matrix_dynamic_dns_container_image_self_build | bool" | |||||
| - name: Ensure Dynamic DNS ddclient.conf installed | |||||
| ansible.builtin.template: | |||||
| src: "{{ role_path }}/templates/ddclient.conf.j2" | |||||
| dest: "{{ matrix_dynamic_dns_config_path }}/ddclient.conf" | |||||
| mode: 0644 | |||||
| owner: "{{ matrix_user_name }}" | |||||
| group: "{{ matrix_group_name }}" | |||||
| - name: Ensure matrix-dynamic-dns container network is created | |||||
| community.general.docker_network: | |||||
| enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" | |||||
| name: "{{ matrix_dynamic_dns_container_network }}" | |||||
| driver: bridge | |||||
| driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" | |||||
| - name: Ensure matrix-dynamic-dns.service installed | |||||
| ansible.builtin.template: | |||||
| src: "{{ role_path }}/templates/systemd/matrix-dynamic-dns.service.j2" | |||||
| dest: "/etc/systemd/system/matrix-dynamic-dns.service" | |||||
| mode: 0644 | |||||
| @@ -1,26 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2020 - 2022 Slavi Pantaleev | |||||
| # SPDX-FileCopyrightText: 2020 Scott Crossen | |||||
| # SPDX-FileCopyrightText: 2022 Marko Weltzer | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| - name: Check existence of matrix-dynamic-dns service | |||||
| ansible.builtin.stat: | |||||
| path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-dynamic-dns.service" | |||||
| register: matrix_dynamic_dns_service_stat | |||||
| - when: matrix_dynamic_dns_service_stat.stat.exists | bool | |||||
| block: | |||||
| - name: Ensure matrix-dynamic-dns is stopped | |||||
| ansible.builtin.service: | |||||
| name: matrix-dynamic-dns | |||||
| state: stopped | |||||
| enabled: false | |||||
| daemon_reload: true | |||||
| - name: Ensure matrix-dynamic-dns.service doesn't exist | |||||
| ansible.builtin.file: | |||||
| path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-dynamic-dns.service" | |||||
| state: absent | |||||
| @@ -1,37 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2020 - 2025 Slavi Pantaleev | |||||
| # SPDX-FileCopyrightText: 2020 Scott Crossen | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| - name: Fail if no matrix-dynamic-dns configurations specified | |||||
| ansible.builtin.fail: | |||||
| msg: >- | |||||
| You need to define at least one configuration in `matrix_dynamic_dns_domain_configurations` for using matrix-dynamic-dns. | |||||
| when: "matrix_dynamic_dns_domain_configurations | length == 0" | |||||
| - name: Fail if required matrix-dynamic-dns settings not defined in configuration blocks | |||||
| ansible.builtin.fail: | |||||
| msg: >- | |||||
| One of the configurations in matrix_dynamic_dns_domain_configurations is missing a required key (domain, protocol). | |||||
| when: "'domain' not in configuration or 'protocol' not in configuration" | |||||
| with_items: "{{ matrix_dynamic_dns_domain_configurations }}" | |||||
| loop_control: | |||||
| loop_var: configuration | |||||
| - name: Fail if required matrix-dynamic-dns settings not defined | |||||
| ansible.builtin.fail: | |||||
| msg: >- | |||||
| You need to define a required configuration setting (`{{ item.name }}`). | |||||
| when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" | |||||
| with_items: | |||||
| - {'name': 'matrix_dynamic_dns_container_network', when: true} | |||||
| - name: (Deprecation) Catch and report renamed matrix-dynamic-dns variables | |||||
| ansible.builtin.fail: | |||||
| msg: >- | |||||
| The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. | |||||
| when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" | |||||
| with_items: | |||||
| - {'old': 'matrix_dynamic_dns_container_image_name_prefix', 'new': 'matrix_dynamic_dns_docker_image_registry_prefix'} | |||||
| @@ -1,78 +0,0 @@ | |||||
| {# | |||||
| SPDX-FileCopyrightText: 2020 Scott Crossen | |||||
| SPDX-FileCopyrightText: 2022 Slavi Pantaleev | |||||
| SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| #} | |||||
| daemon={{ matrix_dynamic_dns_daemon_interval }} | |||||
| syslog=no | |||||
| pid=/var/run/ddclient/ddclient.pid | |||||
| ssl=yes | |||||
| use={{ matrix_dynamic_dns_use }} | |||||
| web='{{ matrix_dynamic_dns_web }}' | |||||
| {% if matrix_dynamic_dns_web_skip %} | |||||
| web-skip='{{ matrix_dynamic_dns_web_skip }}' | |||||
| {% endif %} | |||||
| {% for matrix_dynamic_dns_additional_configuration in matrix_dynamic_dns_additional_configuration_blocks %} | |||||
| {{ matrix_dynamic_dns_additional_configuration }} | |||||
| {% endfor %} | |||||
| {% for dynamic_dns_domain_configuration in matrix_dynamic_dns_domain_configurations %} | |||||
| protocol={{ dynamic_dns_domain_configuration.protocol }} | |||||
| {% if 'apikey' in dynamic_dns_domain_configuration %} | |||||
| apikey={{ dynamic_dns_domain_configuration.apikey }} | |||||
| {% endif %} | |||||
| {% if 'secretapikey' in dynamic_dns_domain_configuration %} | |||||
| secretapikey={{ dynamic_dns_domain_configuration.secretapikey }} | |||||
| {% endif %} | |||||
| {% if 'rootdomain' in dynamic_dns_domain_configuration %} | |||||
| root-domain={{ dynamic_dns_domain_configuration.rootdomain }} | |||||
| {% endif %} | |||||
| {% if 'provider' in dynamic_dns_domain_configuration %} | |||||
| server={{ dynamic_dns_domain_configuration.provider }} | |||||
| {% endif %} | |||||
| {% if 'username' in dynamic_dns_domain_configuration %} | |||||
| login='{{ dynamic_dns_domain_configuration.username }}' | |||||
| {% endif %} | |||||
| {% if 'password' in dynamic_dns_domain_configuration %} | |||||
| password='{{ dynamic_dns_domain_configuration.password }}' | |||||
| {% endif %} | |||||
| {% if 'static' in dynamic_dns_domain_configuration %} | |||||
| static=yes | |||||
| {% endif %} | |||||
| {% if 'custom' in dynamic_dns_domain_configuration %} | |||||
| custom=yes | |||||
| {% endif %} | |||||
| {% if 'zone' in dynamic_dns_domain_configuration %} | |||||
| zone={{ dynamic_dns_domain_configuration.zone }} | |||||
| {% endif %} | |||||
| {% if 'ttl' in dynamic_dns_domain_configuration %} | |||||
| ttl={{ dynamic_dns_domain_configuration.ttl }} | |||||
| {% endif %} | |||||
| {% if 'mx' in dynamic_dns_domain_configuration %} | |||||
| mx={{ dynamic_dns_domain_configuration.mx }} | |||||
| {% endif %} | |||||
| {% if 'wildcard' in dynamic_dns_domain_configuration %} | |||||
| wildcard=yes | |||||
| {% endif %} | |||||
| {% if 'script' in dynamic_dns_domain_configuration %} | |||||
| script={{ dynamic_dns_domain_configuration.script }} | |||||
| {% endif %} | |||||
| {{ dynamic_dns_domain_configuration.domain }} | |||||
| {% endfor %} | |||||
| @@ -1,46 +0,0 @@ | |||||
| #jinja2: lstrip_blocks: True | |||||
| [Unit] | |||||
| Description=Matrix Dynamic DNS | |||||
| {% for service in matrix_dynamic_dns_systemd_required_services_list %} | |||||
| Requires={{ service }} | |||||
| After={{ service }} | |||||
| {% endfor %} | |||||
| {% for service in matrix_dynamic_dns_systemd_wanted_services_list %} | |||||
| Wants={{ service }} | |||||
| {% endfor %} | |||||
| 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 -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-dynamic-dns 2>/dev/null || true' | |||||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-dynamic-dns 2>/dev/null || true' | |||||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ | |||||
| --rm \ | |||||
| --name=matrix-dynamic-dns \ | |||||
| --log-driver=none \ | |||||
| --network={{ matrix_dynamic_dns_container_network }} \ | |||||
| -e PUID={{ matrix_user_uid }} \ | |||||
| -e PGID={{ matrix_user_gid }} \ | |||||
| --mount type=bind,src={{ matrix_dynamic_dns_config_path }},dst=/config \ | |||||
| {% for arg in matrix_dynamic_dns_container_extra_arguments %} | |||||
| {{ arg }} \ | |||||
| {% endfor %} | |||||
| {{ matrix_dynamic_dns_docker_image }} | |||||
| {% for network in matrix_dynamic_dns_container_additional_networks %} | |||||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-dynamic-dns | |||||
| {% endfor %} | |||||
| ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-dynamic-dns | |||||
| ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-dynamic-dns 2>/dev/null || true' | |||||
| ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-dynamic-dns 2>/dev/null || true' | |||||
| Restart=always | |||||
| RestartSec=30 | |||||
| SyslogIdentifier=matrix-dynamic-dns | |||||
| [Install] | |||||
| WantedBy=multi-user.target | |||||
| @@ -1,4 +0,0 @@ | |||||
| SPDX-FileCopyrightText: 2020 - 2025 Slavi Pantaleev | |||||
| SPDX-FileCopyrightText: 2020 Scott Crossen | |||||
| SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| @@ -80,6 +80,11 @@ | |||||
| - {'old': 'cinny_docker_image_registry_prefix_upstream', 'new': 'cinny_container_image_registry_prefix_upstream'} | - {'old': 'cinny_docker_image_registry_prefix_upstream', 'new': 'cinny_container_image_registry_prefix_upstream'} | ||||
| - {'old': 'cinny_docker_image_registry_prefix_upstream_default', 'new': 'cinny_container_image_registry_prefix_upstream_default'} | - {'old': 'cinny_docker_image_registry_prefix_upstream_default', 'new': 'cinny_container_image_registry_prefix_upstream_default'} | ||||
| - {'old': 'ddclient_docker_image', 'new': 'ddclient_container_image'} | |||||
| - {'old': 'ddclient_docker_image_registry_prefix', 'new': 'ddclient_container_image_registry_prefix'} | |||||
| - {'old': 'ddclient_docker_image_registry_prefix_upstream', 'new': 'ddclient_container_image_registry_prefix_upstream'} | |||||
| - {'old': 'ddclient_docker_image_registry_prefix_upstream_default', 'new': 'ddclient_container_image_registry_prefix_upstream_default'} | |||||
| - name: (Deprecation) Catch and report matrix_postgres variables | - name: (Deprecation) Catch and report matrix_postgres variables | ||||
| ansible.builtin.fail: | ansible.builtin.fail: | ||||
| msg: |- | msg: |- | ||||
| @@ -590,6 +595,19 @@ | |||||
| The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^matrix_client_cinny_.+', wantlist=True) | join(', ') }} | The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^matrix_client_cinny_.+', wantlist=True) | join(', ') }} | ||||
| when: "lookup('ansible.builtin.varnames', '^matrix_client_cinny_.+', wantlist=True) | length > 0" | when: "lookup('ansible.builtin.varnames', '^matrix_client_cinny_.+', wantlist=True) | length > 0" | ||||
| - name: (Deprecation) Catch and report matrix-dynamic-dns variables | |||||
| ansible.builtin.fail: | |||||
| msg: |- | |||||
| The matrix-dynamic-dns role in the playbook now lives under the MASH organization (https://github.com/mother-of-all-self-hosting/ansible-role-ddclient). | |||||
| The new role is pretty much the same, but uses differently named variables. | |||||
| Please rename all `matrix_dynamic_dns_`-prefixed variables (`matrix_dynamic_dns_*` -> `ddclient_*`) on your configuration file (vars.yml). | |||||
| After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. | |||||
| The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^matrix_dynamic_dns_.+', wantlist=True) | join(', ') }} | |||||
| when: "lookup('ansible.builtin.varnames', '^matrix_dynamic_dns_.+', wantlist=True) | length > 0" | |||||
| - name: (Deprecation) Catch and report mautrix-facebook variables | - name: (Deprecation) Catch and report mautrix-facebook variables | ||||
| ansible.builtin.fail: | ansible.builtin.fail: | ||||
| msg: |- | msg: |- | ||||
| @@ -42,7 +42,7 @@ | |||||
| - install-all | - install-all | ||||
| - custom/matrix-base | - custom/matrix-base | ||||
| - custom/matrix-dynamic-dns | |||||
| - galaxy/ddclient | |||||
| - galaxy/exim_relay | - galaxy/exim_relay | ||||
| - role: galaxy/postgres | - role: galaxy/postgres | ||||