# virlutils generated ansible file for lab id: {{ lab_id }}, title: {{ lab_title }}
#
# the overall structure of the inventory follows best practices
# at http://docs.ansible.com/ansible/latest/intro_inventory.html

# we've rendered what we think is best if you disagree, override
# virl.generators.ansible_inventory_generator

# you can modify grouping behavior by adding a tag to your nodes:
# ansible_group=GROUP_NAME

all:
  children:

    {%- for group, devices in inventory.all.children.items() %}
    {{group}}:
      hosts:
        {%- for name, device in devices.items() %}

        {{ name }}:
          ansible_host: {{ device.ansible_host }}
          {%- if device.console_server %}
          {%- if device.console_user %}
          {%- if device.console_path %}
          console_server: {{ device.console_server }}
          console_user: {{ device.console_user }}
          console_path: {{ device.console_path }}
          {%- endif %}
          {%- endif %}
          {%- endif %}
          {%- if device.device_type %}
          ansible_network_os: {{ device.device_type }}
          {%- endif %}

        {%- endfor %}
    {% endfor %}
