Resource default values from site.pp not applied

9 views
Skip to first unread message

Dirk Heinrichs

unread,
Oct 31, 2022, 9:48:19 AM10/31/22
to puppet...@googlegroups.com
Hi,

I'm currently stuck with a problem where resource defaults from site.pp are not applied, for example:



if $facts['custom'] == 'some value' {
  Some_resource { attribute => lookup('some.key'), }
  notify { lookup('some.key'): }
  notify { $facts['custom']: }
}

The two notifications appear in the report, with expected values, but the default value for "attribute" of "Some_resource" doesn't get set. Any idea what I'm doing wrong here?

Thanks...

Dirk
-- 
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

Martin Alfke

unread,
Oct 31, 2022, 10:10:34 AM10/31/22
to puppet...@googlegroups.com
Hi Dirk,

Is attribute the correct parameter of some_resource type?
You mention that notify returns the desired results, therefore I assume that hiera returns a proper value for ’some.key’.
Which means that the if facts clause is also working as expected.

Are you overwriting the Some_resource defaults in a class?
Defaults in a class overwrite defaults from site.pp.

Hth,
Martin



--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9c76afa2cb08d2b58be3a4ee461931caab63957f.camel%40opentext.com.

Dirk Heinrichs

unread,
Oct 31, 2022, 10:19:43 AM10/31/22
to puppet...@googlegroups.com
Am Montag, dem 31.10.2022 um 15:10 +0100 schrieb Martin Alfke:

Is attribute the correct parameter of some_resource type?

Yes.

You mention that notify returns the desired results, therefore I assume that hiera returns a proper value for ’some.key’.
Which means that the if facts clause is also working as expected.

Yes, it is.

Are you overwriting the Some_resource defaults in a class?

No, I don't.

Bye...

Martin Alfke

unread,
Oct 31, 2022, 10:29:57 AM10/31/22
to puppet...@googlegroups.com
Next guess:

How do you declare some_resource type?
Are you using standard type declaration:

some_reosurce { ’title’:
  param => ‘value,
  …
}

Or do you use ensure_resource or create_resource function?


--
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...@googlegroups.com.

Dirk Heinrichs

unread,
Oct 31, 2022, 10:32:30 AM10/31/22
to puppet...@googlegroups.com
Am Montag, dem 31.10.2022 um 15:29 +0100 schrieb Martin Alfke:

How do you declare some_resource type?
Are you using standard type declaration:

some_reosurce { ’title’:
  param => ‘value,
  …
}

Yes, like this.

Or do you use ensure_resource or create_resource function?

No, I don't use any of these.

Robin Lee Powell

unread,
Oct 31, 2022, 11:57:32 PM10/31/22
to 'Dirk Heinrichs' via Puppet Users
I don't think we're going to be able to help further without a
fully-working minimal example.

On Mon, Oct 31, 2022 at 02:32:21PM +0000, 'Dirk Heinrichs' via Puppet Users wrote:
> Am Montag, dem 31.10.2022 um 15:29 +0100 schrieb Martin Alfke:
>
> How do you declare some_resource type?
> Are you using standard type declaration:
>
> some_reosurce { ’title’:
> param => ‘value,
> …
> }
>
> Yes, like this.
>
> Or do you use ensure_resource or create_resource function?
>
> No, I don't use any of these.
>
> Bye...
>
> Dirk
>
> --
>
> Dirk Heinrichs
> Senior Systems Engineer, Delivery Pipeline
> OpenText ™ Discovery | Recommind
> Phone: +49 2226 15966 18
> Email: dhei...@opentext.com<mailto:dhei...@opentext.com>
> Website: www.recommind.de<mail://ab5defde1fa49913f64f8482009c4be447b3cf96/Gesendete%20Elemente/www.recommind.de>
> Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
> Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/aef2abaf763263ff7d5d7450ed3cd257c173df6d.camel%40opentext.com.

Dirk Heinrichs

unread,
Nov 2, 2022, 2:29:54 AM11/2/22
to puppet...@googlegroups.com
Am Montag, dem 31.10.2022 um 20:57 -0700 schrieb Robin Lee Powell:

I don't think we're going to be able to help further without a
fully-working minimal example.

Found the reason. I include classes by Hiera lookup. It works if I put the defaults BEFORE

lookup('classes', { merge => unique }).include

Thanks for your efforts.

Bye...

Dirk
-- 
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Reply all
Reply to author
Forward
0 new messages