From 4569713d882f225ce5dfaeb1ac1e62e01f57e5eb Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 5 May 2013 13:43:44 -0400 Subject: [PATCH] Update register_logic example --- examples/playbooks/register_logic.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/playbooks/register_logic.yml b/examples/playbooks/register_logic.yml index 704a8b4c6fe..8e143e472aa 100644 --- a/examples/playbooks/register_logic.yml +++ b/examples/playbooks/register_logic.yml @@ -23,6 +23,11 @@ # here we run the next action only if the previous grep returned true - action: shell echo "motd contains the word hi" - only_if: "${motd_result.rc} == 0" + when: motd_result.rc == 0 + + # alternatively: + + - action: shell echo "motd contains the word hi" + when: motd_result.stdout.find('hi') != -1