---
- hosts: idrac
  connection: local
  name: Configure the iDRAC eventing attributes
  gather_facts: False

  collections:
    - dellemc.openmanage

  tasks:
  - name: Setup iDRAC SMTP
    dellemc_configure_idrac_eventing:
       idrac_ip:   "{{ idrac_ip }}"
       idrac_user: "{{ idrac_user }}"
       idrac_password:  "{{ idrac_password }}"
       share_name: "{{ playbook_dir }}"
       smtp_ip_address: "0.0.0.0"
       authentication: "Enabled"
       username: "test"
       password: "test"

    tags:
      - idrac_smtp

  - name: Setup iDRAC SNMP Trap
    dellemc_configure_idrac_eventing:
       idrac_ip:   "{{ idrac_ip }}"
       idrac_user: "{{ idrac_user }}"
       idrac_password:  "{{ idrac_password }}"
       share_name: "{{ playbook_dir }}"
       snmp_trap_state: "Enabled"
       destination_number: "2"
       snmp_v3_username: "None"
       destination: "1.1.1.1"

    tags:
      - idrac_snmptrap

  - name: Setup iDRAC Email Alerts
    dellemc_configure_idrac_eventing:
       idrac_ip:   "{{ idrac_ip }}"
       idrac_user: "{{ idrac_user }}"
       idrac_password:  "{{ idrac_password }}"
       share_name: "{{ playbook_dir }}"
       email_alert_state: "Disabled"
       address: "test@test.com"
       alert_number: "1"
       custom_message: "test"

    tags:
      - idrac_email_alerts

  - name: Setup iDRAC Alerts
    dellemc_configure_idrac_eventing:
       idrac_ip:   "{{ idrac_ip }}"
       idrac_user: "{{ idrac_user }}"
       idrac_password:  "{{ idrac_password }}"
       share_name: "{{ playbook_dir }}"
       enable_alerts: "Disabled"

    tags:
      - idrac_alerts