---
- name: Dell OpenManage Ansible diagnostics operation.
  hosts: ome
  gather_facts: false

  tasks:
    - name: Application log extraction using CIFS share location
      dellemc.openmanage.ome_diagnostics:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        share_type: CIFS
        share_address: "{{ share_address }}"
        share_user: "{{ share_username }}"
        share_password: "{{ share_password }}"
        share_name: "{{ share_name }}"
        log_type: application
        mask_sensitive_info: false
        test_connection: true
      tags: app-cifs-log
      delegate_to: localhost

    - name: Application log extraction using NFS share location
      dellemc.openmanage.ome_diagnostics:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        share_address: "{{ share_address }}"
        share_type: NFS
        share_name: "{{ share_name }}"
        log_type: application
        mask_sensitive_info: true
        test_connection: true
      tags: app-nfs-log
      delegate_to: localhost

    - name: Support assist log extraction using CIFS share location
      dellemc.openmanage.ome_diagnostics:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        share_address: "{{ share_address }}"
        share_user: "{{ share_username }}"
        share_password: "{{ share_password }}"
        share_name: "{{ share_name }}"
        share_type: CIFS
        log_type: support_assist_collection
        device_ids:
          - 10011
          - 10022
        log_selectors: [OS_LOGS]
        test_connection: true
      tags: tsr-cifs-log
      delegate_to: localhost

    - name: Support assist log extraction using NFS share location
      dellemc.openmanage.ome_diagnostics:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        share_address: "{{ share_address }}"
        share_type: NFS
        share_name: "{{ share_name }}"
        log_type: support_assist_collection
        device_group_name: group_name
        test_connection: true
      tags: tsr-nfs-log
      delegate_to: localhost
