Ansible Lookup Issue

Hello,

Im running the following

set_fact:

host: “{{ lookup(‘nios’, ‘record:host’, filter={‘name’: ‘{{ ansible_facts.fqdn }}’ }, provider=nios_provider) }}”

Im trying to pass the ansible_facts.fqdn as the name. If i use a static host it works.

Thanks

Freddie

You can't use {{ }} inside {{ }}.
You are already in template mode so it does understand variables, try this

  host: "{{ lookup('nios', 'record:host', filter={'name': ansible_facts.fqdn }, provider=nios_provider) }}"

Thanks that worked