Skip to content
Open
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
33 changes: 27 additions & 6 deletions acceptance/tests/lookup/lookup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,23 @@ def mod_manifest_metadata_json(module_name = nil, testdir)
"project_page": null,
"issues_url": null,
"dependencies": [
],
"data_provider": "function"
]
}
',
mode => "0644",
}
# Hiera 5 module layer: bind the module data function
# (replaces the removed metadata.json "data_provider" key)
file { '#{testdir}/environments/production/modules/#{module_name}/hiera.yaml':
ensure => file,
content => '---
version: 5
hierarchy:
- name: "Module data function"
v4_data_hash: #{module_name}::data
',
mode => "0644",
}
file { '#{testdir}/environments/production/modules/#{module_name}/lib/puppet/bindings':
ensure => absent,
force => true,
Expand Down Expand Up @@ -202,14 +213,24 @@ def mod_manifest_metadata_json(module_name = nil, testdir)
ensure => file,
content => '
environment_timeout = 0
# for this environment, provide our own function to supply data to lookup
# implies a ruby function in <environment>/lib/puppet/functions/environment/data.rb
# named environment::data()
environment_data_provider = "function"
',
mode => "0640",
}

# Hiera 5 environment layer: bind the environment data function
# (replaces the removed environment_data_provider setting; the function
# lives in <environment>/lib/puppet/functions/environment/data.rb)
file { '#{testdir}/environments/production/hiera.yaml':
ensure => file,
content => '---
version: 5
hierarchy:
- name: "Environment data function"
v4_data_hash: environment::data
',
mode => "0640",
}

# the function to provide data for this environment
file { '#{testdir}/environments/production/lib/puppet/functions/environment/data.rb':
ensure => file,
Expand Down
Loading