rabbitmq_publish – Publish a message to a RabbitMQ queue¶
New in version 2.8.
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:[email protected]: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:[email protected]:5672/%2F"
queue: 'images'
file: 'path/to/logo.gif'
- name: RabbitMQ auto generated queue
rabbitmq_publish:
url: "amqp://guest:[email protected]: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]
Authors¶
John Imison (@Im0)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.