diff options
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index df85ff0..e511a10 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -19,6 +19,9 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) reset(@resource.value(:revision)) end end + if @resource.value(:ensure) != :bare + update_submodules + end end end @@ -39,6 +42,9 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) def revision=(desired) fetch reset(desired) + unless @resource.value(:ensure) == :bare + update_submodules + end end def bare_exists? @@ -150,4 +156,11 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) end end + def update_submodules + at_path do + git('submodule', 'init') + git('submodule', 'update') + end + end + end |