-1

So I am creating a module to manage some coldfusion servers.

I my init.pp I am trying to define a default site.

::coldfusion::site { 'default':
  site_number => $site_number,
}

The resource is defined in manifest\site.pp as

define coldfusion::site (
  $site_number = undef,
)
{
  include coldfusion
  include coldfusion::params
}

When I run the pdk test unit to run the unit tests for my module I get the error "Unknown resource type: '::coldfusion::site'".

I checked the spec fixtures modules and there is a symlink to the project files so it should be able to resolve the class.

Not sure whether the problem resides.

Powertoaster
  • 85
  • 1
  • 1
  • 7
  • That looks like both invalid syntax and invalid usage. – Matthew Schuchard Dec 01 '18 at 13:16
  • So I am trying to model this after the puppetlabs-apache module. It uses the same setup for apache::vhost. My syntax and usage match that exactly. see https://puppet.com/docs/puppet/5.3/lang_defined_types.html#defining-a-type – Powertoaster Dec 01 '18 at 13:32
  • So after Matt's comment I looked through the code again and changed the site.pp to a define which what they do in the apache sample. I am now getting "Could not find class ::coldfusion::site". – Powertoaster Dec 01 '18 at 13:46

2 Answers2

0

Thanks again to Matt for a basic but perhaps overly terse message, I spent some time looking over the docs again and after changing the resource definition from Class to Define and then removing the site_spec since it is no longer a class everything is working.

Powertoaster
  • 85
  • 1
  • 1
  • 7
-1

::coldfusion::site { 'default': site_number => $site_number,}

change above to

coldfusion::site { 'default': site_number => $site_number, }

:: can be used with top scope resources or change your define which should starts with ::