From b1c767e4633881349e6d9523c83f5de92c65dd70 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 3 Nov 2015 22:57:23 -0500 Subject: [PATCH 1/3] Add ensure parameter so we can remove plugins. --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 088fb4a..0570832 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -1,6 +1,6 @@ -define vim::plugin ($source) { +define vim::plugin ($source, $ensure=present) { vcsrepo { "${vim::home_dir}/.vim/bundle/${name}": - ensure => present, + ensure => $ensure, provider => git, user => $vim::user, source => $source, From c60736f676b65fbc55da4d234c158fcf4e66651a Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 16 Apr 2016 18:19:17 -0400 Subject: [PATCH 2/3] Work around bug for vcsrepo with ensure=>absent running every time. Conflicts: manifests/plugin.pp --- manifests/plugin.pp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0570832..a7ba84c 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -1,8 +1,18 @@ define vim::plugin ($source, $ensure=present) { - vcsrepo { "${vim::home_dir}/.vim/bundle/${name}": - ensure => $ensure, - provider => git, - user => $vim::user, - source => $source, + # See https://tickets.puppetlabs.com/browse/MODULES-731 + # ensure => absent runs every time and says + # Notice: /Stage[main]/Profile::Root::Vim/Amantes::Vim[root]/Vim::Plugin[root:vim-session]/Vcsrepo[/root/.vim/bundle/vim-session]/ensure: created + # wrap it in an if instead + if $ensure != 'absent' { + vcsrepo { "${vim::home_dir}/.vim/bundle/${name}": + ensure => $ensure, + provider => git, + user => $vim::user, + source => $source, + } + } else { + file { "${vim::home_dir}/.vim/bundle/${name}": + ensure => absent + } } } From 456b0f644d580a8a09938b3fa19564b90744a81f Mon Sep 17 00:00:00 2001 From: root Date: Mon, 23 May 2016 10:02:07 -0400 Subject: [PATCH 3/3] Use force => true so we really remove old dirs --- manifests/plugin.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a7ba84c..dc51963 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -12,7 +12,8 @@ } } else { file { "${vim::home_dir}/.vim/bundle/${name}": - ensure => absent + ensure => absent, + force => true, } } }