summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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