Resource collector inside a resource definition?

asked 2015-09-29 09:16:09 -0600

amckinley gravatar image

I am attempting to use a resource collector for my firewall from within a defined resource type. The resource collector doesn't appear to do anything, where the same code works inline inside a class definition.

For example, if I use following statement inside a class it works correctly.

Firewalld::Zone <| title == 'public' |> { ports +> [{port => 80,protocol => tcp,}] }

If I use the same code inside a defined resource type:

define my_type ($new_port) {
  Firewalld::Zone <| title == 'public' |> { ports +> [{port => $new_port,protocol => tcp,}] }
}

And then define a resource in my class:

my_type {"my_type_test":
  $new_port => 80,
}

The resource collector seems to silently do nothing.

Is this documented behaviour? The list of contexts where a resource collector cannot be used doesn't seem to preclude this.

I am using puppet version 3.8.2.

edit retag flag offensive close merge delete