--- - name: Set current_host_config variable to access parameters referencing this host set_fact: current_host_config: "{{ item.value }}" when: item.value.hostname == inventory_hostname with_dict: "{{ configs.host_config }}"