---
- hosts: ome
  connection: local
  name: Dell OpenManage Ansible template inventory details.
  gather_facts: False

  collections:
    - dellemc.openmanage

  tasks:
    - name: Retrieve basic details of all templates.
      ome_template_info:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"

    - name: Retrieve details of a specific template identified by its template ID.
      ome_template_info:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        template_id: "{{template_id}}"

    - name: Get filtered template info based on name.
      ome_template_info:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        system_query_options:
          filter: "Name eq 'new template'"