Ansible and temporary dynamic hosts

Ansible has a task called add_host . It adds extra hosts to the inventory at play execution time. It has two non obvious properties, though. First, such a host is not automatically selected as execution target during current play. Only subsequent plays, that run in the same execution context, can match such new host with host selectors. The other is that such added hosts will stay in the inventory…