The commented section of the following code works. I was trying to simplify it by adding with_items; however, it seems to change the way it is evaluated?.. at least that is my guess based on the verbosity:
`
skipping: [ansible-oel6] => (item=ansible) => {
“changed”: false,
“item”: “ansible”,
“skip_reason”: “Conditional result was False”
}
Using with_items like you are, you would need to use search(item) without the quotes around item. Otherwise “item” is treated as the string item, instead of the variable called item.
That is good to know, but I made the change and still experience the issue; however, with that info I changed it to the following which works for the first section: