How to identify if a optional attribute of resource is present in node configuration on puppet client run
15 views
Skip to first unread message
smartway
unread,
Sep 29, 2014, 1:44:37 AM9/29/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppe...@googlegroups.com
A optional attribute of a resource defaults to a value which is not supported on one of the platforms. I want add a platform check to block the attribute, if the attribute is given by user throw a error. Type file for this resource is present in other module which i cannot modify. Is there a way to know if the attribute in present in manifest file and add a check for same in my module.
Henrik Lindberg
unread,
Sep 29, 2014, 11:01:01 AM9/29/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppe...@googlegroups.com
On 2014-29-09 7:44, smartway wrote:
>
> A optional attribute of a resource defaults to a value which is not
> supported
> on one of the platforms.
If it defaults to an illegal value via the Resource Defaults mechanism,
it will be difficult to look it up.
> I want add a platform check to block the attribute, if the attribute is
> given by user throw a error.
> Type file for this resource is present in other module which i cannot
> modify.
> Is there a way to know if the attribute in present in manifest file and
> add a check for same in
> my module.
>
The order of evaluation makes this difficult. You can perhaps use a
collect expression with an override to set value to something else.
Making it fail in this case is more difficult, something crazy like
evaluating faulty overrides may work - e.g.