I am using puppet 4.3 and it looks like the new function lookup provider is 
not working, unless i am missing something. 
I am working from this: 
https://docs.puppetlabs.com/puppet/latest/reference/lookup_quick_module.html

I am just testing with this simple example. 
% puppet status 
{
  "is_alive": true,
  "version": "4.3.2"
}

% tree
.
├── data
│   └── common.yaml
├── functions
│   └── data.pp
├── hiera.yaml
├── manifests
│   └── init.pp
├── metadata.jason
└── templates
    └── vartmp.erb
#==================================

% cat functions/data.pp 
function vartmp::data() {

  $base_params = {
    'vartmp::localerb'   => 'vartmp/vartmp.erb',
    'vartmp::vtfile'     => '/var/tmp/VAR-TMP-FILE',
  }

  $base_params
}

#==================================
% cat manifests/init.pp 
# Class : vartmp
#
class vartmp (
  $vtfile,
  $localerb
) {

  file { $vtfile:
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template($localerb),
  }

}

#==================================
% egrep data metadata.jason
  "data_provider": "function"
#==================================

puppet-lint and pupper parser validate both return clean. 

#==================================
On client.
% puppet status
{
  "is_alive": true,
  "version": "4.3.2"
}

% puppet agent -t 
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Evaluation Error: Error while evaluating a Resource Statement, 
Class[Vartmp]:
  expects a value for parameter 'localerb'
  expects a value for parameter 'vtfile' on node puppetclient
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Anybody know/see what i am missing? 
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f424077b-1656-4626-b971-033433a570e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to