1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add check mode support to ansible-pull (#28021)

Fixes #27989
This commit is contained in:
giovannisciortino 2017-08-14 17:20:05 +02:00 committed by Sam Doran
parent fe2e17f7cd
commit d3e48a51f5

View file

@ -107,6 +107,8 @@ class PullCLI(CLI):
help='modified files in the working repository will be discarded')
self.parser.add_option('--track-subs', dest='tracksubs', default=False, action='store_true',
help='submodules will track the latest changes. This is equivalent to specifying the --remote flag to git submodule update')
self.parser.add_option("--check", default=False, dest='check', action='store_true',
help="don't make any changes; instead, try to predict some of the changes that may occur")
# for pull we don't want a default
self.parser.set_defaults(inventory=None)
@ -243,6 +245,8 @@ class PullCLI(CLI):
cmd += ' -l "%s"' % self.options.subset
else:
cmd += ' -l "%s"' % limit_opts
if self.options.check:
cmd += ' -C'
os.chdir(self.options.dest)