samdoran.mosquitto
Mosquitto
This installs Eclipse Mosquitto, a lightweight MQTT broker.
Requirements
- EPEL repository
- Docker (if you are using a container)
Role Variables
Name | Default Value | Description |
---|---|---|
mqtt_installation_method |
native |
Installation method: native or container |
mqtt_directories |
[see defaults/main.yml] |
Directories for configuration, data, and logs |
mqtt_config_files |
[see defaults/main.yml] |
Configuration files |
mqtt_touch_files |
[see defaults/main.yml] |
Touch files |
mqtt_include_dir |
{{ mqtt_config_dir }}/conf.d |
Directory for additional configs |
mqtt_accounts |
[] |
List of accounts with access to the broker |
mqtt_container_name |
mqtt |
Name of the running container |
mqtt_image_name |
eclipse-mosquitto |
The image name to pull |
mqtt_container_network_mode |
bridge |
Networking mode for the container |
mqtt_container_restart_policy |
always |
Policy for container restart |
mqtt_container_data_path |
/mosquitto |
Path inside container for config |
mqtt_container_state |
started |
Current state of the container |
mqtt_container_published_ports |
[see defaults/main.yml] |
Ports published from the container |
mqtt_container_volumes |
[see defaults/main.yml] |
Volumes mounted into the container |
mqtt_sys_interval |
10 |
System interval |
mqtt_store_clean_interval |
10 |
Store clean interval |
mqtt_pid_file |
/var/run/mosquitto.pid |
PID file location |
mqtt_user |
mosquitto |
User for Mosquitto |
mqtt_max_inflight_messages |
20 |
Maximum messages in flight |
mqtt_max_inflight_bytes |
0 |
Maximum bytes in flight |
mqtt_max_queued_messages |
100 |
Maximum queued messages |
mqtt_max_queued_bytes |
0 |
Maximum queued bytes |
mqtt_queue_qos0_messages |
false |
Whether to queue QoS 0 messages |
mqtt_message_size_limit |
0 |
Limit for message size |
mqtt_allow_zero_length_clientid |
true |
Allow zero-length client IDs |
mqtt_auto_id_prefix |
`` | Auto ID prefix |
mqtt_persistent_client_expiration |
1d |
Expiration for persistent clients |
mqtt_allow_duplicate_messages |
false |
Allow duplicate messages |
mqtt_upgrade_outgoing_qos |
false |
Upgrade outgoing QoS |
mqtt_set_tcp_nodelay |
false |
Set TCP NoDelay option |
mqtt_per_listener_settings |
false |
Per-listener settings |
mqtt_bind_address |
{{ ansible_facts.default_ipv4_address }} |
Bind address |
mqtt_port |
1883 |
Port for Mosquitto |
mqtt_max_connections |
-1 |
Maximum connections allowed |
mqtt_protocol |
mqtt |
Protocol used |
mqtt_http_dir |
{{ mqtt_data_dir }} |
Directory for HTTP files |
mqtt_use_username_as_clientid |
false |
Use username as client ID |
mqtt_cafile |
'' |
CA file for TLS |
mqtt_capath |
'' |
CA path for TLS |
mqtt_certfile |
'' |
Certificate file for TLS |
mqtt_keyfile |
'' |
Key file for TLS |
mqtt_tls_version |
1.2 |
TLS version |
mqtt_require_certificate |
false |
Require certificate for TLS |
mqtt_use_identity_as_username |
false |
Use identity as username |
mqtt_use_subject_as_username |
false |
Use subject as username |
mqtt_crlfile |
'' |
Certificate revocation list file |
mqtt_ciphers |
DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH |
Cipher settings |
mqtt_psk_hint |
Greetings from mosquitto |
Hint for pre-shared key |
mqtt_listeners |
[] |
List of listeners |
mqtt_mount_point |
'' |
Mount point for the broker |
mqtt_autosave_interval |
1800 |
Autosave interval |
mqtt_autosave_on_changes |
false |
Autosave on config changes |
mqtt_persistence |
false |
Enable persistence |
mqtt_persistence_file |
mosquitto.db |
Persistence file |
mqtt_persistence_location |
{{ mqtt_data_dir }}/ |
Location for persistence files |
mqtt_log_dests |
[file /var/log/mosquitto.log] |
Log destinations |
mqtt_log_facility |
daemon |
Log facility |
mqtt_log_types |
[error, warning] |
Types of log messages |
mqtt_websockets_log_level |
0 |
Log level for WebSockets |
mqtt_connection_messages |
true |
Log connection messages |
mqtt_log_timestamp |
true |
Include timestamp in logs |
mqtt_clientid_prefixes |
false |
Prefixes for client IDs |
mqtt_allow_anonymous |
true |
Allow anonymous access |
mqtt_password_file |
{{ mqtt_config_dir }}/passwd |
Password file for authentication |
mqtt_psk_file |
'' |
Pre-shared key file |
mqtt_acl_file |
{{ mqtt_config_dir }}/acl |
Access control list file |
mqtt_auth_plugins |
[] |
Authentication plugins |
mqtt_connection |
<name> |
Name of the connection |
mqtt_address |
<host>[:<port>] [<host>[:<port>]] |
Address of the remote broker |
mqtt_topic |
` |
in |
mqtt_bridge_protocol_version |
mqttv311 |
Protocol version for bridge |
mqtt_bridge_attempt_unsubscribe |
true |
Attempt to unsubscribe on bridge |
mqtt_round_robin |
false |
Round-robin for connection |
mqtt_remote_clientid |
`` | Remote client ID |
mqtt_local_clientid |
false |
Local client ID |
mqtt_cleansession |
false |
Clean session flag |
mqtt_notifications |
true |
Enable notifications |
mqtt_notification_topic |
$SYS/broker/connection/<clientid>/state |
Notification topic |
mqtt_keepalive_interval |
60 |
Keep-alive interval |
mqtt_start_type |
automatic |
Start type for the broker |
mqtt_restart_timeout |
30 |
Restart timeout |
mqtt_idle_timeout |
60 |
Idle timeout |
mqtt_threshold |
10 |
Threshold for connections |
mqtt_try_private |
true |
Try private connection |
mqtt_remote_username |
`` | Remote username |
mqtt_remote_password |
`` | Remote password |
mqtt_bridge_cafile |
`` | CA file for bridge |
mqtt_bridge_capath |
`` | CA path for bridge |
mqtt_bridge_certfile |
`` | Certificate file for bridge |
mqtt_bridge_keyfile |
`` | Key file for bridge |
mqtt_bridge_insecure |
false |
Insecure connection for bridge |
mqtt_bridge_identity |
`` | Identity for bridge |
mqtt_bridge_psk |
`` | Pre-shared key for bridge |
Dependencies
samdoran.repo_epel
samdoran.docker
(only if using a container)
Example Playbook
- hosts: all
tasks:
- import_role:
name: samdoran.repo_epel
- import_role:
name: samdoran.mosquitto
License
Apache 2.0