Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --limit to calls to ansible and ansible-playbook #1595

Merged
merged 1 commit into from
Nov 12, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/ansible-pull
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ def main(args):
now = datetime.datetime.now()
print >>sys.stderr, now.strftime("Starting ansible-pull at %F %T")

limit_opts = 'localhost:%s:127.0.0.1' % socket.getfqdn()
git_opts = "repo=%s dest=%s version=%s" % (options.url, options.dest, options.checkout)
cmd = 'ansible all -c local -m git -a "%s"' % git_opts
cmd = 'ansible all -c local --limit "%s" -m git -a "%s"' % (limit_opts, git_opts)
rc = _run(cmd)
if rc != 0:
return rc
Expand All @@ -127,7 +128,7 @@ def main(args):
print >>sys.stderr, "Could not find a playbook to run."
return 1

cmd = 'ansible-playbook -c local %s' % playbook
cmd = 'ansible-playbook -c local --limit "%s" %s' % (limit_opts, playbook)
os.chdir(options.dest)
rc = _run(cmd)

Expand Down