From af249b83e6361ba1bf5527652db81671704fed58 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 27 Jun 2016 18:57:24 -0500 Subject: [PATCH] Don't modify the original task ds when preprocessing data In the case of using YAML anchors/aliases, YAML actually uses references to the duplicated object so any modifications to the original impacts later uses of the object. Fixes #13575 --- lib/ansible/playbook/task.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index c55f32b2c41..36a511312d3 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -196,7 +196,7 @@ class Task(Base, Conditional, Taggable, Become): if 'vars' in ds: # _load_vars is defined in Base, and is used to load a dictionary # or list of dictionaries in a standard way - new_ds['vars'] = self._load_vars(None, ds.pop('vars')) + new_ds['vars'] = self._load_vars(None, ds.get('vars')) else: new_ds['vars'] = dict()