summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSteve Gargan <steve.gargan@gmail.com>2015-03-17 21:25:45 +0000
committerSteve Gargan <steve.gargan@gmail.com>2015-03-17 21:25:45 +0000
commit4ce791fe84e1ba800ad57fb790455181f08a0687 (patch)
tree10d33f3f718ea783d4c27e94c73fb4e0b615571e /bin
parentf8ec1451eae9a0bf3003a5d047144a43d3dee9e0 (diff)
downloadansible-4ce791fe84e1ba800ad57fb790455181f08a0687.tar.gz
avoid path issues by determining the path of ansible-pull and using its path to run ansible and ansible-playbook
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ansible-pull9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/ansible-pull b/bin/ansible-pull
index a9a0897fbf..d4887631e0 100755
--- a/bin/ansible-pull
+++ b/bin/ansible-pull
@@ -186,9 +186,12 @@ def main(args):
if path is None:
sys.stderr.write("module '%s' not found.\n" % options.module_name)
return 1
- cmd = 'ansible localhost -i "%s" %s -m %s -a "%s"' % (
- inv_opts, base_opts, options.module_name, repo_opts
+
+ bin_path = os.path.dirname(os.path.abspath(__file__))
+ cmd = '%s/ansible localhost -i "%s" %s -m %s -a "%s"' % (
+ bin_path, inv_opts, base_opts, options.module_name, repo_opts
)
+
for ev in options.extra_vars:
cmd += ' -e "%s"' % ev
@@ -221,7 +224,7 @@ def main(args):
print >>sys.stderr, "Could not find a playbook to run."
return 1
- cmd = 'ansible-playbook %s %s' % (base_opts, playbook)
+ cmd = '%s/ansible-playbook %s %s' % (bin_path, base_opts, playbook)
if options.vault_password_file:
cmd += " --vault-password-file=%s" % options.vault_password_file
if options.inventory: