From 1e3df3b5ab786557e104bbe55258e299b831b09f Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 2 Feb 2013 12:19:21 -0500 Subject: [PATCH] Show how to assign lookup plugins in variables --- docsite/rst/playbooks2.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docsite/rst/playbooks2.rst b/docsite/rst/playbooks2.rst index 960cbdac70..2ce96c64c5 100644 --- a/docsite/rst/playbooks2.rst +++ b/docsite/rst/playbooks2.rst @@ -500,6 +500,14 @@ Many new lookup abilities were added in 0.9. Remeber lookup plugins are run on with_template: - ./some_template.j2 +You can also assign these to variables, should you wish to do this instead, that will be evaluated +when they are used in a task (or template):: + + vars: + redis_value: msg=$LOOKUP(redis,redis://localhost:6379,info_${inventory_hostname}) + tasks: + - debug: msg=Redis value for host is $redis_value + .. versionadded: 1.0 'with_sequence' generates a sequence of items in ascending numerical order. You