ansible_playbook_python (#18530)

* ansible_playbook_python

fixes #18471

* fix tests

* removed dupe
This commit is contained in:
Brian Coca
2016-11-23 16:30:46 -05:00
committed by GitHub
parent 21813ed83e
commit 778c983ef9
5 changed files with 11 additions and 9 deletions

View File

@@ -694,7 +694,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
pass
# remove some KNOWN keys
for hard in ['ansible_rsync_path']:
for hard in ['ansible_rsync_path', 'ansible_playbook_python']:
if hard in fact_keys:
remove_keys.add(hard)

View File

@@ -20,6 +20,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import sys
from collections import defaultdict, MutableMapping
@@ -392,6 +393,7 @@ class VariableManager:
variables = dict()
variables['playbook_dir'] = loader.get_basedir()
variables['ansible_playbook_python'] = sys.executable
if host:
variables['group_names'] = sorted([group.name for group in host.get_groups() if group.name != 'all'])