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.