File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ nodejs::global_config_entries : {}
3+
4+ lookup_options :
5+ nodejs::global_config_entries :
6+ merge :
7+ strategy : deep
Original file line number Diff line number Diff line change 1+ ---
2+ version : 5
3+ defaults :
4+ datadir : ' data'
5+ data_hash : ' yaml_data'
6+ hierarchy :
7+ - name : ' Major Version'
8+ path : ' %{facts.os.name}-%{facts.os.release.major}.yaml'
9+ - name : ' Distribution Name'
10+ path : ' %{facts.os.name}.yaml'
11+ - name : ' common'
12+ path : ' common.yaml'
Original file line number Diff line number Diff line change 11# == Class: nodejs: See README.md for documentation.
2+ #
3+ # @param global_config_entries Create resources with nodejs::npm::global_config_entry
24class nodejs (
35 $cmd_exe_path = $nodejs::params::cmd_exe_path,
46 Boolean $manage_nodejs_package = true ,
2628 $repo_url_suffix = $nodejs::params::repo_url_suffix,
2729 Array $use_flags = $nodejs::params::use_flags,
2830 Optional[String] $package_provider = $nodejs::params::package_provider,
31+ Hash $global_config_entries,
2932) inherits nodejs::params {
3033 if $manage_package_repo and !$repo_class {
3134 fail(" ${module_name} : The manage_package_repo parameter was set to true but no repo_class was provided." )
3942 Class[$repo_class ]
4043 -> Class[' nodejs::install' ]
4144 }
45+
46+ create_resources(' nodejs::npm::global_config_entry' , $global_config_entries )
4247}
Original file line number Diff line number Diff line change 309309 is_expected . not_to contain_package ( 'npm' )
310310 end
311311 end
312+
313+ context 'with global_config_entries' do
314+ let :params do
315+ {
316+ global_config_entries : {
317+ 'proxy' => { 'value' => 'https://proxy.com' }
318+ }
319+ }
320+ end
321+
322+ it do
323+ is_expected . to contain_nodejs__npm__global_config_entry ( 'proxy' ) . with (
324+ value : 'https://proxy.com'
325+ )
326+ end
327+ end
312328 end
313329 end
314330
You can’t perform that action at this time.
0 commit comments