diff --git a/manifests/init.pp b/manifests/init.pp index 43c65b3..eb2f392 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -62,11 +62,13 @@ $package_source = $package_url } - if $ensure in ['installed', 'present'] { + if !$download and $ensure in ['installed', 'present'] { $package_ensure = $version ? { '' => 'present', default => $version, } + } elsif $download and $ensure in ['installed', 'present'] { + $package_ensure = $ensure } else { $package_ensure = absent } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5ef52ec..68a8007 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -39,7 +39,7 @@ ) { # If the source is a gem file, then we have to tell `vagrant plugin install` # to use the file instead of $name. - if $source =~ /-(\d+\..+)\.gem$/ { + if $source and $source =~ /-(\d+\..+)\.gem$/ { $gem = true $plugin_name = $source } else {