From 5ba4e4411b5f76a83191fc45e2509219c0e343e0 Mon Sep 17 00:00:00 2001 From: John Imison <857198+Im0@users.noreply.github.com> Date: Wed, 24 Oct 2018 22:38:32 +1100 Subject: [PATCH] Adding headers to be returned for retrieved messages. (#47375) --- lib/ansible/plugins/lookup/rabbitmq.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/lookup/rabbitmq.py b/lib/ansible/plugins/lookup/rabbitmq.py index 4ca258af70..cc4ee91b9f 100644 --- a/lib/ansible/plugins/lookup/rabbitmq.py +++ b/lib/ansible/plugins/lookup/rabbitmq.py @@ -88,6 +88,9 @@ RETURN = """ routing_key: description: The routing_key on the message in the queue. type: str + headers: + description: The headers for the message returned from the queue. + type: dict json: description: If application/json is specified in content_type, json will be loaded into variables. type: dict @@ -161,7 +164,8 @@ class LookupModule(LookupBase): 'redelivered': method_frame.redelivered, 'exchange': method_frame.exchange, 'delivery_mode': properties.delivery_mode, - 'content_type': properties.content_type + 'content_type': properties.content_type, + 'headers': properties.headers }) if properties.content_type == 'application/json': try: