mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge branch 'devel' of https://github.com/jflorian/ansible into jflorian-devel
This commit is contained in:
commit
97e3e967a7
2 changed files with 15 additions and 1 deletions
|
@ -103,6 +103,10 @@ def main(args):
|
||||||
help='purge checkout after playbook run')
|
help='purge checkout after playbook run')
|
||||||
parser.add_option('-o', '--only-if-changed', dest='ifchanged', default=False, action='store_true',
|
parser.add_option('-o', '--only-if-changed', dest='ifchanged', default=False, action='store_true',
|
||||||
help='only run the playbook if the repository has been updated')
|
help='only run the playbook if the repository has been updated')
|
||||||
|
parser.add_option('-f', '--force', dest='force', default=False,
|
||||||
|
action='store_true',
|
||||||
|
help='run the playbook even if the repository could '
|
||||||
|
'not be updated')
|
||||||
parser.add_option('-d', '--directory', dest='dest', default=None,
|
parser.add_option('-d', '--directory', dest='dest', default=None,
|
||||||
help='directory to checkout repository to')
|
help='directory to checkout repository to')
|
||||||
parser.add_option('-U', '--url', dest='url', default=None,
|
parser.add_option('-U', '--url', dest='url', default=None,
|
||||||
|
@ -146,6 +150,10 @@ def main(args):
|
||||||
)
|
)
|
||||||
rc, out = _run(cmd)
|
rc, out = _run(cmd)
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
|
if options.force:
|
||||||
|
print("Unable to update repository. Continuing with (forced) "
|
||||||
|
"run of playbook.")
|
||||||
|
else:
|
||||||
return rc
|
return rc
|
||||||
elif options.ifchanged and '"changed": true' not in out:
|
elif options.ifchanged and '"changed": true' not in out:
|
||||||
print "Repository has not changed, quitting."
|
print "Repository has not changed, quitting."
|
||||||
|
|
|
@ -63,6 +63,12 @@ URL of the playbook repository to checkout.
|
||||||
Branch/Tag/Commit to checkout. If not provided, uses default behavior
|
Branch/Tag/Commit to checkout. If not provided, uses default behavior
|
||||||
of module used to check out playbook repository.
|
of module used to check out playbook repository.
|
||||||
|
|
||||||
|
*-f*, *--force*::
|
||||||
|
|
||||||
|
Force running of playbook even if unable to update playbook repository. This
|
||||||
|
can be useful, for example, to enforce run-time state when a network
|
||||||
|
connection may not always be up or possible.
|
||||||
|
|
||||||
*-i* 'PATH', *--inventory=*'PATH'::
|
*-i* 'PATH', *--inventory=*'PATH'::
|
||||||
|
|
||||||
The 'PATH' to the inventory hosts file. This can be a relative path within
|
The 'PATH' to the inventory hosts file. This can be a relative path within
|
||||||
|
|
Loading…
Reference in a new issue