Foreman_subnets with Puppet 4

Hello everyone,

I have a custom firewall module that defines a resource which creates rules based on values in foreman_subnets. So in my module I say:

firewall::foreman_subnet { $::foreman_subnets: }

…and it creates rules for each of the subnets in the array of hashes.

This worked great in Puppet 3, but Puppet 4 rejects this $title with:

Illegal title type at index 0.  Expected String, got Has[String, String] at...

Does anyone have any recommendations for converting/handling this data in a way that makes Puppet 4 happy? I can certainly update the resource to accept parameters or whatever. I'm not just sure how to handle the "iteration" (creating an instance for each network, where the number of networks is not fixed).

Regards,

j

I ended up using each() to solve this issue, but if someone has a better idea I'm all ears.

j

··· ----- Original Message ----- From: "'Jason B. Nance' via Foreman users" To: foreman-users@googlegroups.com Sent: Thursday, December 29, 2016 4:32:12 PM Subject: [foreman-users] foreman_subnets with Puppet 4

Hello everyone,

I have a custom firewall module that defines a resource which creates rules based on values in foreman_subnets. So in my module I say:

firewall::foreman_subnet { $::foreman_subnets: }

…and it creates rules for each of the subnets in the array of hashes.

This worked great in Puppet 3, but Puppet 4 rejects this $title with:

Illegal title type at index 0.  Expected String, got Has[String, String] at...

Does anyone have any recommendations for converting/handling this data in a way that makes Puppet 4 happy? I can certainly update the resource to accept parameters or whatever. I’m not just sure how to handle the “iteration” (creating an instance for each network, where the number of networks is not fixed).

Regards,

j


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.