Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to work with directory environments #54

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/vagrant-librarian-puppet/action/librarian_puppet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def provision(puppetfile_dir, env, config)
placeholder_file = File.join(
env[:root_path],
puppetfile_dir,
'modules',
config.modules_dirname,
config.placeholder_filename
)
if File.exist? placeholder_file
Expand All @@ -58,6 +58,7 @@ def provision(puppetfile_dir, env, config)
})
environment.config_db.local['destructive'] = config.destructive.to_s
environment.config_db.local['use-v1-api'] = config.use_v1_api
environment.config_db.local['path'] = config.modules_dirname

Librarian::Action::Ensure.new(environment).run
Librarian::Action::Resolve.new(environment, config.resolve_options).run
Expand Down
3 changes: 3 additions & 0 deletions lib/vagrant-librarian-puppet/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ class Config < Vagrant.plugin(2, :config)
attr_accessor :destructive
attr_accessor :placeholder_filename
attr_accessor :resolve_options
attr_accessor :modules_dirname

def initialize
@puppetfile_dir = UNSET_VALUE
@placeholder_filename = UNSET_VALUE
@use_v1_api = UNSET_VALUE
@destructive = UNSET_VALUE
@resolve_options = UNSET_VALUE
@modules_dirname = UNSET_VALUE
end

def finalize!
Expand All @@ -21,6 +23,7 @@ def finalize!
@resolve_options = {} if @resolve_options == UNSET_VALUE
@use_v1_api = '1' if @use_v1_api == UNSET_VALUE
@destructive = true if @destructive == UNSET_VALUE
@modules_dirname = 'modules' if @modules_dirname = UNSET_VALUE
end

def validate(machine)
Expand Down