diff --git a/lib/ansible/playbook.py b/lib/ansible/playbook.py index ea2294ebb74..282f2828efd 100755 --- a/lib/ansible/playbook.py +++ b/lib/ansible/playbook.py @@ -449,7 +449,7 @@ class PlayBook(object): # magic in Runner() push_var_str='' for (k,v) in vars.iteritems(): - push_var_str += "%s=%s " % (k,v) + push_var_str += "%s=\"%s\" " % (k,v) # push any variables down to the system setup_results = ansible.runner.Runner( diff --git a/test/TestPlayBook.py b/test/TestPlayBook.py index ecfce412a84..47ce55945c6 100644 --- a/test/TestPlayBook.py +++ b/test/TestPlayBook.py @@ -117,3 +117,7 @@ class TestRunner(unittest.TestCase): print utils.bigjson(actual) assert cmp(expected, actual) == 0, "expected events match actual events" + # make sure the template module took options from the vars section + data = file('/tmp/ansible_test_data_template.out').read() + assert data.find("ears") != -1, "template success" + diff --git a/test/playbook1.yml b/test/playbook1.yml index 5894348ecd3..d1f6b2902c1 100644 --- a/test/playbook1.yml +++ b/test/playbook1.yml @@ -2,7 +2,7 @@ --- - hosts: all vars: - answer: "???" + answer: "Wuh, I think so, Brain, but if we didn't have ears, we'd look like weasels." port: 5150 tasks: