Foreman variables interpolation in matcher

How realize this instance?

Matcher: fqdn = 'foo'
Value: $ip

And after run puppet on client, i got real ip?

Something like this in old topic:
https://groups.google.com/forum/#!msg/foreman-users/c5W1l08FQm8/n_3drXaal3EJ

I found solution.
interpolation must be in puppet manifest like this:

··· --- environment: development classes: php: source_dir: "${domain}" init.pp

class php (
$source_dir = params_lookup( ‘source_dir’ ),
) {

$conf = regsubst($php::source_dir, ‘${’, ‘#{’, ‘G’)
$conf1 = inline_template("<%= %Q($php::conf) %>"
notify{“test $php::conf1”:}

}

воскресенье, 17 марта 2013 г., 1:01:04 UTC+4 пользователь Vlados Vladosov написал:

How realize this instance?

Matcher: fqdn = 'foo’
Value: $ip

And after run puppet on client, i got real ip?

Something like this in old topic:

https://groups.google.com/forum/#!msg/foreman-users/c5W1l08FQm8/n_3drXaal3EJ

I'm glad you found a solution. Hopefully for Foreman 1.2, we'll have
this feature added:

Support dynamic ERB parameters in global and class params
http://projects.theforeman.org/issues/2260

This will let you then use <%= ip %> in a matcher value.

··· On 16/03/13 21:01, Vlados Vladosov wrote: > How realize this instance? > > Matcher: fqdn = 'foo' > Value: $ip > > And after run puppet on client, i got real ip? > > Something like this in old topic: > https://groups.google.com/forum/#!msg/foreman-users/c5W1l08FQm8/n_3drXaal3EJ


Dominic Cleal
Red Hat Engineering