From e5f845e83e9768319c139ccbf8f28665139172fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Mon, 3 Jul 2023 13:10:38 +0200 Subject: [PATCH 1/7] Add docs, requirements and systemd --- docs/services/mosquitto.md | 23 +++++++++++++++++++++++ docs/services/rumqttd.md | 4 ++++ docs/supported-services.md | 1 + group_vars/mash_servers | 28 ++++++++++++++++++++++++++++ requirements.yml | 5 ++++- setup.yml | 2 ++ 6 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 docs/services/mosquitto.md diff --git a/docs/services/mosquitto.md b/docs/services/mosquitto.md new file mode 100644 index 0000000..aa0666c --- /dev/null +++ b/docs/services/mosquitto.md @@ -0,0 +1,23 @@ +# Mosquitto Ansible Role + + +[Mosquitto](https://mosquitto.org/) is an open source [MQTT](https://en.wikipedia.org/wiki/MQTT) broker. + + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +mosquitto_enabled: true +``` + +## Usage + +After installation, you can use `just run-tags mosquitto-add-user --extra-vars=username= --extra-vars=password="` to create a user. For the setting to take effect, you must restart the container. + +You can then start to send and subscribe to MQTT topics. Use port 1883 and the servers IP or any domain you configured to point at this server. + +## Alternatives + +* [rumqttd](rumqttd.md) is another MQTT broker diff --git a/docs/services/rumqttd.md b/docs/services/rumqttd.md index 44da4bd..ea4692f 100644 --- a/docs/services/rumqttd.md +++ b/docs/services/rumqttd.md @@ -35,3 +35,7 @@ rumqttd_enabled: true ## Usage You can then start to send and subscribe to MQTT topics. Use port 1883 and the servers IP or any domain you configured to point at this server. + +## Alternatives + +* [Mosquitto](mosquitto.md) is another, more feature-complete MQTT broker diff --git a/docs/supported-services.md b/docs/supported-services.md index be2f76d..b650b80 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -27,6 +27,7 @@ | [MariaDB](https://mariadb.org/) | A powerful, open source object-relational database system | [Link](services/mariadb.md) | | [Matrix Rooms Search API](https://gitlab.com/etke.cc/mrs/api) | A fully-featured, standalone, matrix rooms search service. | [Link](services/mrs.md) | | [MongoDB](https://www.mongodb.com/) | A source-available cross-platform document-oriented (NoSQL) database program. | [Link](services/mongodb.md) | +| [Mosquitto](https://mosquitto.org/) | An open-source MQTT broker | [Link](services/mosquitto.md) | | [Miniflux](https://miniflux.app/) | Minimalist and opinionated feed reader. | [Link](services/miniflux.md) | | [Mobilizon](https://joinmobilizon.org/en/) | An ActivityPub/Fediverse server to create and share events. | [Link](services/mobilizon.md) | | [Navidrome](https://www.navidrome.org/) | [Subsonic-API](http://www.subsonic.org/pages/api.jsp) compatible music server | [Link](services/navidrome.md) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index dc2b427..3c264c6 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -149,6 +149,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (mongodb_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'mongodb']}] if mongodb_enabled else []) + + ([{'name': (mosquitto_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'mosquitto']}] if mosquitto_enabled else []) + + ([{'name': (mrs_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'mrs']}] if mrs_enabled else []) + ([{'name': (navidrome_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'navidrome']}] if navidrome_enabled else []) @@ -1766,7 +1768,33 @@ mongodb_managed_databases_auto: | # # ######################################################################## +######################################################################## +# # +# mosquitto # +# # +######################################################################## +mosquitto_enabled: false + +mosquitto_identifier: "{{ mash_playbook_service_identifier_prefix }}mosquitto" + +mosquitto_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}mosquitto" + +mosquitto_uid: "{{ mash_playbook_uid }}" +mosquitto_gid: "{{ mash_playbook_gid }}" + +mosquitto_systemd_required_services_list: | + {{ + (['docker.service']) + }} + + + +######################################################################## +# # +# /mosquitto # +# # +######################################################################## ######################################################################## diff --git a/requirements.yml b/requirements.yml index c59ce2f..9536631 100644 --- a/requirements.yml +++ b/requirements.yml @@ -105,7 +105,10 @@ name: mobilizon - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mongodb.git version: v6.0.6-0 - name: mongodb + name: mosquitto +- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mosquitto.git + version: v2.0.15-0 + name: mosquitto - src: git+https://gitlab.com/etke.cc/mrs/ansible-role-mrs.git version: v0.0.0-9 name: mrs diff --git a/setup.yml b/setup.yml index 12f2d0b..9e2b933 100644 --- a/setup.yml +++ b/setup.yml @@ -104,6 +104,8 @@ - role: galaxy/mobilizon + - role: galaxy/mosquitto + - role: galaxy/navidrome - role: galaxy/netbox From add8445c88d04da7ba1751959746e6c0b8290cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Mon, 3 Jul 2023 13:12:23 +0200 Subject: [PATCH 2/7] Fix requirements --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 9536631..d83c993 100644 --- a/requirements.yml +++ b/requirements.yml @@ -105,7 +105,7 @@ name: mobilizon - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mongodb.git version: v6.0.6-0 - name: mosquitto + name: mongodb - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mosquitto.git version: v2.0.15-0 name: mosquitto From d84caf49b3335e930258ef67fada5f29e68454b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 6 Jul 2023 11:53:20 +0200 Subject: [PATCH 3/7] Fix alignment, formatting and remove double default --- group_vars/mash_servers | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 3c264c6..1de25dd 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -1770,7 +1770,7 @@ mongodb_managed_databases_auto: | ######################################################################## # # -# mosquitto # +# mosquitto # # # ######################################################################## @@ -1783,16 +1783,9 @@ mosquitto_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_bas mosquitto_uid: "{{ mash_playbook_uid }}" mosquitto_gid: "{{ mash_playbook_gid }}" -mosquitto_systemd_required_services_list: | - {{ - (['docker.service']) - }} - - - ######################################################################## # # -# /mosquitto # +# /mosquitto # # # ######################################################################## From f23940ef5286b62cb441ef081a8a1972e2c8d3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 6 Jul 2023 11:58:34 +0200 Subject: [PATCH 4/7] Document port and how to restart --- docs/services/mosquitto.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/services/mosquitto.md b/docs/services/mosquitto.md index aa0666c..aa5ae76 100644 --- a/docs/services/mosquitto.md +++ b/docs/services/mosquitto.md @@ -10,11 +10,14 @@ To enable this service, add the following configuration to your `vars.yml` file ```yaml mosquitto_enabled: true + +# If you need to change the MQTT port you can uncomment and adjust +# mosquitto_container_mqtt_host_bind_port: "1884" ``` ## Usage -After installation, you can use `just run-tags mosquitto-add-user --extra-vars=username= --extra-vars=password="` to create a user. For the setting to take effect, you must restart the container. +After installation, you can use `just run-tags mosquitto-add-user --extra-vars=username= --extra-vars=password=` to create a user. For the setting to take effect, you must restart the container. To do that you can use `just restart-group mosquitto`. You can then start to send and subscribe to MQTT topics. Use port 1883 and the servers IP or any domain you configured to point at this server. From d0d6bff3ca5e871663c2ff81ea87b5b5f426376d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 6 Jul 2023 12:00:59 +0200 Subject: [PATCH 5/7] Bump mosquitto role version --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index d83c993..65eac5d 100644 --- a/requirements.yml +++ b/requirements.yml @@ -107,7 +107,7 @@ version: v6.0.6-0 name: mongodb - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mosquitto.git - version: v2.0.15-0 + version: v2.0.15-1 name: mosquitto - src: git+https://gitlab.com/etke.cc/mrs/ansible-role-mrs.git version: v0.0.0-9 From a09b60e7c1b3d60c9905cdc53a75e46a9506f764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 6 Jul 2023 12:08:32 +0200 Subject: [PATCH 6/7] Correct just command as there is no restart but start actually restarts --- docs/services/mosquitto.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/services/mosquitto.md b/docs/services/mosquitto.md index aa5ae76..0e27da5 100644 --- a/docs/services/mosquitto.md +++ b/docs/services/mosquitto.md @@ -17,7 +17,7 @@ mosquitto_enabled: true ## Usage -After installation, you can use `just run-tags mosquitto-add-user --extra-vars=username= --extra-vars=password=` to create a user. For the setting to take effect, you must restart the container. To do that you can use `just restart-group mosquitto`. +After installation, you can use `just run-tags mosquitto-add-user --extra-vars=username= --extra-vars=password=` to create a user. For the setting to take effect, you must restart the container. To do that you can use `just start-group mosquitto`. You can then start to send and subscribe to MQTT topics. Use port 1883 and the servers IP or any domain you configured to point at this server. From 634858e6886caeeee5f4e421a104d5ddb858f1c8 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 6 Jul 2023 16:20:16 +0300 Subject: [PATCH 7/7] Update mosquitto.md --- docs/services/mosquitto.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/services/mosquitto.md b/docs/services/mosquitto.md index 0e27da5..c9e20a9 100644 --- a/docs/services/mosquitto.md +++ b/docs/services/mosquitto.md @@ -1,5 +1,4 @@ -# Mosquitto Ansible Role - +# Mosquitto [Mosquitto](https://mosquitto.org/) is an open source [MQTT](https://en.wikipedia.org/wiki/MQTT) broker. @@ -19,7 +18,7 @@ mosquitto_enabled: true After installation, you can use `just run-tags mosquitto-add-user --extra-vars=username= --extra-vars=password=` to create a user. For the setting to take effect, you must restart the container. To do that you can use `just start-group mosquitto`. -You can then start to send and subscribe to MQTT topics. Use port 1883 and the servers IP or any domain you configured to point at this server. +You can then start to send and subscribe to MQTT topics. Use port `1883` and the server's IP or any domain you configured to point to this server. ## Alternatives