First, licensed_hosts is actually a list, not a dictionary, the dash
(-) signifies 'list item'
Second, you don't need to lookup ansible_fqdn as that should be part
of fact gathering which isnormally automatic, so this should "just
work":
when: "{{ ansible_fqdn in licensed_hosts}}"
--
Brian Coca