You either need a appconfig/manifests/init.pp class, or you can make use of 
stdlib::manage class and add the defined type to hiera
See examples in https://dev.to/betadots/puppet-is-yaml-2e32

> On 28. Aug 2023, at 21:23, Ben Parry <the.benpa...@gmail.com> wrote:
> 
> Puppeteers,
> 
> I am bashing my head against a wall try to call a custom defined resource (I 
> think that's the right terminology) from Heira.
> 
> I've created a class (appconfig) and within that I have used Puppet PDK to 
> create a define to create an application config file (loadconf).  It works 
> perfectly if I call the code from a Puppet manifest, like so;
> 
> appconfig::loadconf {
>    '/etc/myapp/config.conf':
>     tcpport  => 443
>     loglevel => debug }
> 
> It's pretty much identical to the Puppet supplied example;
> 
> https://www.puppet.com/docs/puppet/7/lang_defined_types.html
> 
> The problem is I want separate my data from the puppet code.  I am using 
> Hiera (5) and when I add what I think should be in the YAML for calling my 
> custom resource it does NOTHING!  No Error message, nothing it just completes 
> normally without calling my custom resource.  My Hiera YAML document looks 
> something like this;
> 
> ---
> classes:
>   - appconfig
> 
> appconfig::loadconf:
>   /etc/myapp/config.conf:
>     tcpport: 443
>     loglevel: debug
> 
> I have no idea why this is not being evaluated.  I have also tried using a 
> 3rd party module to load with no results just message saying no such 
> resource.  I used this module (which is excellent!);
> 
> https://forge.puppet.com/modules/southalc/types
> 
> 
> -- 
> 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 
> <mailto:puppet-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/2cb98212-2bc1-4ce7-80db-0cb84eb16b23n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/puppet-users/2cb98212-2bc1-4ce7-80db-0cb84eb16b23n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/2794C7F5-BF2A-4B11-A8A5-A1B149092590%40gmail.com.

Reply via email to