ANSIBLE_DIST_MODULE_PATH environment variable

This commit is contained in:
Skylar Saveland 2013-09-16 13:43:20 -07:00
parent 4d352e69fc
commit 8dc31f3093

View file

@ -82,9 +82,12 @@ active_user = pwd.getpwuid(os.geteuid())[0]
# Needed so the RPM can call setup.py and have modules land in the
# correct location. See #1277 for discussion
if getattr(sys, "real_prefix", None):
# in a virtualenv
DIST_MODULE_PATH = os.path.join(sys.prefix, 'share/ansible/')
else:
DIST_MODULE_PATH = '/usr/share/ansible/'
# custom ansible location without a virtualenv
DIST_MODULE_PATH = os.environ.get("ANSIBLE_DIST_MODULE_PATH", DIST_MODULE_PATH)
# sections in config file
DEFAULTS='defaults'