Virtual Resources with Variables

22 views
Skip to first unread message

Doug Warner

unread,
Jun 15, 2010, 9:24:48 AM6/15/10
to Puppet Users
I've seen the workarounds to use the concatenated file resource to fake this,
but is it possible to use something like virtual resources to realize an
array? My pseudo-classes would be like this:

class foo {
@$arr = ['a', 'b']

realize($arr)
}

class foo::c inherits foo {
$arr += ['c']
}

class foo::d inherits foo {
$arr += ['d']
}

node ab {
include foo
}

node abc {
include foo:c
}

node abcd {
include foo:c
include foo:d
}

I think the way things currently are, node "abc" would be fine but node "abcd"
would fail because of trying to reassign the variable.

If not virtual resouces, what is the best way to append to an array when you
don't know what the final outcome of the array needs to be?

-Doug

signature.asc
Reply all
Reply to author
Forward
0 new messages