From 4ae3bee41626e182bf687bee49df1b1909649a9b Mon Sep 17 00:00:00 2001 From: Stephen Fromm Date: Sun, 11 Nov 2012 00:11:58 -0800 Subject: [PATCH] Add --limit to calls to ansible and ansible-playbook --limit takes localhost, FQDN, and 127.0.0.1. --- bin/ansible-pull | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/ansible-pull b/bin/ansible-pull index 7863d3b695..89356c7b68 100755 --- a/bin/ansible-pull +++ b/bin/ansible-pull @@ -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 @@ -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)