Skip to content

Commit

Permalink
fetch the git repo before trying to find a playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
copperlight authored and sfromm committed Oct 12, 2012
1 parent 788e11f commit 2b24131
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bin/ansible-pull
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ def main(args):
now = datetime.datetime.now()
print now.strftime("ansible-pull_started: %Y%m%d-%H%M-%S"), "\n"

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
print "cmd=%s" % cmd, "\n"
rc = _run(cmd)
if rc != 0:
return rc

hostname = "%s.yml" % platform.node()

if not args:
Expand Down Expand Up @@ -117,14 +124,6 @@ def main(args):

print

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
print "cmd=%s" % cmd, "\n"
rc = _run(cmd)
if rc != 0:
return rc


cmd = 'ansible-playbook -c local %s' % playbook
print "cmd=%s" % cmd
os.chdir(options.dest)
Expand Down

0 comments on commit 2b24131

Please sign in to comment.