rabbitmq_publish – Publish a message to a RabbitMQ queue¶
New in version 2.8.
Synopsis¶
Publish a message on a RabbitMQ queue using a blocking connection.
Requirements¶
The below requirements are needed on the host that executes this module.
pika
Parameters¶
Notes¶
Note
This module requires the pika python library https://pika.readthedocs.io/.
Pika is a pure-Python implementation of the AMQP 0-9-1 protocol that tries to stay fairly independent of the underlying network support library.
This plugin is tested against RabbitMQ. Other AMQP 0.9.1 protocol based servers may work but not tested/guaranteed.
Examples¶
- name: Publish a message to a queue with headers
rabbitmq_publish:
url: "amqp://guest:guest@192.168.0.32:5672/%2F"
queue: 'test'
body: "Hello world from ansible module rabbitmq_publish"
content_type: "text/plain"
headers:
myHeader: myHeaderValue
- name: Publish a file to a queue
rabbitmq_publish:
url: "amqp://guest:guest@192.168.0.32:5672/%2F"
queue: 'images'
file: 'path/to/logo.gif'
- name: RabbitMQ auto generated queue
rabbitmq_publish:
url: "amqp://guest:guest@192.168.0.32:5672/%2F"
body: "Hello world random queue from ansible module rabbitmq_publish"
content_type: "text/plain"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]