From 8dc31f309316248324481c1ed3c82c5427f9b10b Mon Sep 17 00:00:00 2001 From: Skylar Saveland Date: Mon, 16 Sep 2013 13:43:20 -0700 Subject: [PATCH] ANSIBLE_DIST_MODULE_PATH environment variable --- lib/ansible/constants.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index b9941c2e93..eb474090ef 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -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'