mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fetch the git repo before trying to find a playbook
This commit is contained in:
parent
788e11f1db
commit
2b24131baa
1 changed files with 7 additions and 8 deletions
|
@ -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:
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue