Author: | Jan-Piet Mens |
---|
parameter | required | default | choices | comments |
---|---|---|---|---|
client_id | no | hostname + pid | MQTT client identifier | |
password | no | Password for username to authenticate against the broker. |
||
payload | yes | Payload. The special string "None" may be used to send a NULL (i.e. empty) payload which is useful to simply notify with the topic or to clear previously retained messages. |
||
port | no | 1883 | MQTT broker port number | |
qos | no |
|
QoS (Quality of Service) | |
retain | no | Setting this flag causes the broker to retain (i.e. keep) the message so that applications that subsequently subscribe to the topic can received the last retained message immediately. | ||
server | no | localhost | MQTT broker address/name | |
topic | yes | MQTT topic name | ||
username | no | Username to authenticate against the broker. |
Note
Requires mosquitto
- local_action: mqtt
topic=service/ansible/{{ ansible_hostname }}
payload="Hello at {{ ansible_date_time.iso8601 }}"
qos=0
retain=false
client_id=ans001
Note
This module requires a connection to an MQTT broker such as Mosquitto http://mosquitto.org and the mosquitto Python module (http://mosquitto.org/python).