Carlos Laviola
05/24/2023, 1:53 PMif $elligible_hosts.any |$host| { $facts[networking][fqdn] == $host } {
$activate_ensure = file
} else {
$activate_ensure = absent
}
In this case it's to determine whether I want to materialise a particular file on a node or not.
(I also tried a ternary operator in a selector, but at the time I was just trying to implicitly do the equivalent of any
between my variable and the fact. maybe I can also do it using the lambda or member()
, but I admit I haven't tried.)