Why is target a property and no param

8 views
Skip to first unread message

Stefan Schulte

unread,
Nov 21, 2010, 4:31:15 AM11/21/10
to puppe...@googlegroups.com
Hi,

I have a general question about parameter vs property. I always thought
that a property is something that can be insync or outofsync, so thats
something that puppet can check and correct.

But when I look at the current types, then "target" is always defined as
a property. So can target be outofsync? I guess not, because (when I see
it correctly, e.g. for the parsedfile provider) when we ask the provider
about is the is-value of target it will always report the shouldvalue
from the resource. So it is always in sync. Shouldn't target be a
parameter then?

-Stefan

Luke Kanies

unread,
Nov 30, 2010, 3:38:43 PM11/30/10
to puppe...@googlegroups.com

The reason target is a property is because a resource can be moved from one file to another, and the only way I could find to implement that was to make target a property.

It's always felt messy to do it that way, but I've never found another way.

--
Meeting, n.:
An assembly of people coming together to decide what person or
department not represented in the room must solve a problem.
---------------------------------------------------------------------
Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199


Stefan Schulte

unread,
Jan 6, 2011, 8:36:24 AM1/6/11
to puppe...@googlegroups.com
On Tue, Nov 30, 2010 at 12:38:43PM -0800, Luke Kanies wrote:
> The reason target is a property is because a resource can be moved from one file to another, and the only way I could find to implement that was to make target a property.
>
> It's always felt messy to do it that way, but I've never found another way.

Is this feature used anywhere? At least it's not what I expect puppet to
do and I'm a bit afraid that managing e.g. an ssh_authorized_key for one
user can erase the key from the authorized keys file of other users
as soon as puppet is aware of that second target.

-Stefan

Luke Kanies

unread,
Jan 6, 2011, 12:23:49 PM1/6/11
to puppe...@googlegroups.com

I think the ssh_authorized_key type is one of the reasons I set it up that way, actually.

It's kind of an automatic byproduct of how resources are managed across multiple files - all files are considered to be a single pool of resources, so you have to have a means of saying you want a resource moved from one file to another.

--
Humphrey's Law of the Efficacy of Prayer:
In a dangerous world there will always be more people around whose
prayers for their own safety have been answered than those whose
prayers have not.

Reply all
Reply to author
Forward
0 new messages