summaryrefslogtreecommitdiff
path: root/lib/puppet
diff options
context:
space:
mode:
authorMorgan Haskel <morgan@puppetlabs.com>2014-06-19 14:22:11 -0400
committerMorgan Haskel <morgan@puppetlabs.com>2014-06-19 14:22:11 -0400
commit5a61e814677859661b473cea31c51ab8e43cb11c (patch)
tree38d445847075d50a8865e4c435a9ee36d6893f52 /lib/puppet
parentb1f2c00ca300d6c22833b2af7af0839ad751966a (diff)
parentbf94296c505357c1d2bee08ad7785c5666338a36 (diff)
downloadpuppet-vcsrepo-5a61e814677859661b473cea31c51ab8e43cb11c.tar.gz
puppet-vcsrepo-5a61e814677859661b473cea31c51ab8e43cb11c.tar.bz2
Merge pull request #153 from petems/MODULES-1014/add-noop-mode
(MODULES-1014) Adding noop mode option
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/type/vcsrepo.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb
index 3dd7bc6..0e4450b 100644
--- a/lib/puppet/type/vcsrepo.rb
+++ b/lib/puppet/type/vcsrepo.rb
@@ -98,10 +98,15 @@ Puppet::Type.newtype(:vcsrepo) do
if prov
if prov.working_copy_exists?
if @resource.value(:force)
- notice "Deleting current repository before recloning"
- prov.destroy
- notice "Create repository from latest"
- prov.create
+ if noop?
+ notice "Noop Mode - Would have deleted repository"
+ notice "Noop Mode - Would have created repository from latest"
+ else
+ notice "Deleting current repository before recloning"
+ prov.destroy
+ notice "Create repository from latest"
+ prov.create
+ end
end
(@should.include?(:latest) && prov.latest?) ? :latest : :present
elsif prov.class.feature?(:bare_repositories) and prov.bare_exists?
@@ -208,4 +213,12 @@ Puppet::Type.newtype(:vcsrepo) do
['git', 'git-core']
end
+ def noop?
+ if defined?(@noop)
+ @noop
+ else
+ Puppet[:noop]
+ end
+ end
+
end