diff --git a/lib/r10k/action/deploy/module.rb b/lib/r10k/action/deploy/module.rb index ff2b8a4d4..6e3415351 100644 --- a/lib/r10k/action/deploy/module.rb +++ b/lib/r10k/action/deploy/module.rb @@ -72,7 +72,11 @@ def visit_module(mod) end def allowed_initialize_opts - super.merge(environment: true, 'no-force': :self, 'generate-types': :self, 'puppet-path': :self) + super.merge(environment: true, + cachedir: :self, + 'no-force': :self, + 'generate-types': :self, + 'puppet-path': :self) end end end diff --git a/spec/unit/action/deploy/module_spec.rb b/spec/unit/action/deploy/module_spec.rb index daa719828..82e1115b2 100644 --- a/spec/unit/action/deploy/module_spec.rb +++ b/spec/unit/action/deploy/module_spec.rb @@ -25,6 +25,10 @@ it 'can accept a puppet-path option' do described_class.new({ 'puppet-path': '/nonexistent' }, []) end + + it 'can accept a cachedir option' do + described_class.new({ cachedir: '/nonexistent' }, []) + end end describe "with no-force" do @@ -123,4 +127,13 @@ expect(subject.instance_variable_get(:@puppet_path)).to eq('/nonexistent') end end + + describe 'with cachedir' do + + subject { described_class.new({ config: '/some/nonexistent/path', cachedir: '/nonexistent' }, []) } + + it 'sets puppet_path' do + expect(subject.instance_variable_get(:@cachedir)).to eq('/nonexistent') + end + end end