diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2021-09-01 18:29:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 11:29:50 -0500 |
commit | a6f24c407c7e01c5eb29e223c3a8789e889fe08e (patch) | |
tree | 9b93d7ca2179deefbeae7fe7d1b8d4ae5bac8e71 /lib | |
parent | 999c2e603df0e482cc32e1465502872d3308087b (diff) | |
download | ansible-a6f24c407c7e01c5eb29e223c3a8789e889fe08e.tar.gz |
Fix templating task action with host-specific vars (#75600) (#75613)
Fixes #75568
(cherry picked from commit 9c2f44b8848a317a2304254eba0b9b348d5034ad)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ansible/plugins/strategy/linear.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ansible/plugins/strategy/linear.py b/lib/ansible/plugins/strategy/linear.py index d22f03e9f0..8b43498343 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -263,16 +263,16 @@ class StrategyModule(StrategyBase): # sets BYPASS_HOST_LOOP to true, or if it has run_once enabled. If so, we # will only send this task to the first host in the list. - task.action = templar.template(task.action) + task_action = templar.template(task.action) try: - action = action_loader.get(task.action, class_only=True, collection_list=task.collections) + action = action_loader.get(task_action, class_only=True, collection_list=task.collections) except KeyError: # we don't care here, because the action may simply not have a # corresponding action plugin action = None - if task.action in C._ACTION_META: + if task_action in C._ACTION_META: # for the linear strategy, we run meta tasks just once and for # all hosts currently being iterated over rather than one host results.extend(self._execute_meta(task, play_context, iterator, host)) |