Hello,
I’ve got playbook with dynamic inventory. And what bothers me is, that add_host is case sensitive.
So when I have in my initial inventory
Hello,
I’ve got playbook with dynamic inventory. And what bothers me is, that add_host is case sensitive.
So when I have in my initial inventory
Instead of modifying add_host to ignore case, why not just pass the values through the jinja2 ‘lower’ filter when passing them to add_host in your playbook? You can even do something like the following to de-dupe with existing inventory hosts:
{{ (list_with_new_hosts | map(“lower”)) | difference(groups.all | map(“lower”)) }}
This will give you a list of hosts that only exist in the new list, taking into account case differences, with all results in lowercase.
thanks for pointing map, previously I had in my playbook temporary facts.