Avoid to add a host manually as an attribute
class::define { 'title':
attribute3 => [
'stone',
'wood'
],
hosts => [
'host1.domain',
'host2.domain'
]
}
class::define { 'title2':
attribute3 => [
'fire',
'water'
],
hosts => [
'host3.domaintwo',
'host4.domaintwo'
]
}
by using exported resources:
if $fqdn =~ /^.*\.domain$/ {
@@class::define { 'title':
attribute3 => [
'stone',
'wood'
],
hosts => $fqdn
tag => 'test3'
}
}
if $fqdn =~ /^.*\.domaintwo$/ {
@@class::define { 'title2':
attribute3 => [
'fire',
'water'
],
hosts => $fqdn
tag => 'test4'
}
}
but this will not work
Question
How to declare exported resources as an attribute?
fqdn
values in one array value forhosts
?hosts
array