---
- name: Register contents of CSV
  set_fact:
    r_csv_hosts: "{{ lookup('template', 'templates/csv_inventory.j2') }}"
  when:
    - __dman_import is not defined


- name: Register contents of DMAN dump
  set_fact:
    r_csv_hosts: "{{ lookup('template', 'templates/dman_inventory.j2') }}"
  when:
    - __dman_import is defined


...
