# main task to import template files
#   Example:
#     runtime_templates:
#       - type: dir
#         path: C/authsvc/api
#       - type: file
#         path: C/authsvc/api
#         filename: uploads/template_files/s
#         name: success_response.json
#       - type: file
#         path: C/authsvc/api
#         filename: uploads/template_files/s
#         name: success_response.html
---
- name: Import template files
  isam:
    appliance: "{{ inventory_hostname }}"
    adminProxyProtocol: "{{ adminProxyProtocol | default(omit) }}"
    adminProxyHostname: "{{ adminProxyHostname | default(omit) }}"
    adminProxyPort: "{{ adminProxyPort | default(omit) }}"
    adminProxyApplianceShortName: "{{ adminProxyApplianceShortName | default(omit) }}"
    omitAdminProxy: "{{ omitAdminProxy | default(omit) }}"
    username:  "{{ username }}"
    password:  "{{ password }}"
    lmi_port:  "{{ port | default(omit) }}"
    log:       "{{ log_level | default(omit) }}"
    force:     "{{ force | default(omit) }}"
    action: ibmsecurity.isam.aac.runtime_template.file.import_file
    isamapi:
      name: "{{ item.name }}"
      path: "{{ item.path }}"
      filename: "{{ inventory_dir }}/{{ item.filename }}"
  with_items: "{{ runtime_templates }}"
  when: item.type == "file"
  notify: Commit Changes
# main task to import template files
#   Example:
#     runtime_templates:
#       - type: file
#         filename: uploads/template_files/s.json
#         id: C/authsvc/api/success_response.json
#       - type: file
#         filename: uploads/template_files/s.html
#         id: C/authsvc/api/success_response.html
---
- name: Import template files
  isam:
    appliance: "{{ inventory_hostname }}"
    adminProxyProtocol: "{{ adminProxyProtocol | default(omit) }}"
    adminProxyHostname: "{{ adminProxyHostname | default(omit) }}"
    adminProxyPort: "{{ adminProxyPort | default(omit) }}"
    adminProxyApplianceShortName: "{{ adminProxyApplianceShortName | default(omit) }}"
    omitAdminProxy: "{{ omitAdminProxy | default(omit) }}"
    username:  "{{ username }}"
    password:  "{{ password }}"
    lmi_port:  "{{ port | default(omit) }}"
    log:       "{{ log_level | default(omit) }}"
    force:     "{{ force | default(omit) }}"
    action: ibmsecurity.isam.aac.runtime_template.file.import_file
    isamapi:
      id: "{{ item.id }}"
      filename: "{{ item.filename }}"
  with_items: "{{ runtime_templates }}"
  when: item.type == "file"
  notify: Commit Changes

Use 'id' parameter required by the python lib
Use 'id' parameter required by the python lib

remove "inventory_dir" var