---
- name: Dell OpenManage Ansible template identity pool attach and detach operation.
  hosts: ome
  gather_facts: false

  tasks:
    - name: Attach an identity pool to a template.
      dellemc.openmanage.ome_template_identity_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        template_name: template_name
        identity_pool_name: identity_pool_name
      tags:
        - attach
      delegate_to: localhost

    - name: Detach an identity pool from a template.
      dellemc.openmanage.ome_template_identity_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        template_name: template_name
      tags:
        - detach
      delegate_to: localhost
