{% for item in subnets_facts.subnets %}
- canonical_facts:
    id: "{{ item.subnet_id }}"
    status: "{{ item.state }}"
{% if item.tags != {} %}
    tags:
{% for key, value in item.tags.items() %}
      {{ key }}: {{ value }}
{% endfor %}
{% else %}
    tags: {}
{% endif %}
  facts:
    device_type: {{ networking_facts.subnet }}
{% for key, value in networking_common_facts.items()%}
    {{ key }}: {{ value }}
{% endfor %}
{% endfor %}