Thanks Steven.

On Tue, 29 Jan 2019, 22:12 <steven.pritch...@onyxpoint.com wrote:

> $facts['interfaces'] is a string, not an array.  For an array of
> interface names, either use $facts['interfaces'].split(',') or
> $facts['networking']['interfaces'].keys().
>
> Other than that, your logic should work fine.
>
> On Monday, January 28, 2019 at 3:35:23 PM UTC-6, Abhishek singh wrote:
>>
>> Hello Group,
>>
>> I am trying to use facts like interfaces and based on the available
>> interfaces perform  a common task.
>>
>> Please help me out for below:
>>
>> 1. How  strings from core facts and local variable can be compared?
>>
>> For example if interfaces has "eth0, lo, .." and i want to match from it.
>>
>>
>> 1. if ('lo' in $facts['interfaces'])     # it is not working but also no
>> validation error.
>>
>>
>>
>> 2.    if  ! ($facts['interfaces'] in [ 'lo', 'ens160' ])   # it is not
>> working but also no validation error.
>>
>>
>> is it possible to put a condition on facts existence itself?
>>
>> like if ipaddress_eth0 is then perform action from code/enter in loop.
>>
>>
>> Please help me out.
>> Also, Please suggest any links for future understanding.
>>
>> Thanks.
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/d2191cce-ed39-4e01-a3ad-e6cb363dcd26%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/d2191cce-ed39-4e01-a3ad-e6cb363dcd26%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACeG0RQOHiojBdZ%3D4_mr9E5CqnAV8XkEVrm3wsG%3DjTpBekteeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to