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

  collections:
    - dellemc.openmanage

  tasks:
  - name: Setup iDRAC Webserver
    dellemc_configure_idrac_services:
       idrac_ip:   "{{ idrac_ip }}"
       idrac_user: "{{ idrac_user }}"
       idrac_password:  "{{ idrac_password }}"
       share_name: "{{ playbook_dir }}"
       ssl_encryption: "T_168_Bit_or_higher"
       tls_protocol: "TLS_1_0_and_Higher"

    tags:
       - idrac_webserver

  - name: Setup iDRAC SNMP
    dellemc_configure_idrac_services:
       idrac_ip:   "{{ idrac_ip }}"
       idrac_user: "{{ idrac_user }}"
       idrac_password:  "{{ idrac_password }}"
       share_name: "{{ playbook_dir }}"
       snmp_enable: "Enabled"
       snmp_protocol: "All"

    tags:
       - idrac_snmp

  - name: Setup iDRAC SNMP settings
    dellemc_configure_idrac_services:
      idrac_ip: "{{ idrac_ip }}"
      idrac_user: "{{ idrac_user }}"
      idrac_password:  "{{ idrac_password }}"
      share_name: "{{ playbook_dir }}"
      ipmi_lan:
        community_name: public
      alert_port: 161
      trap_format: SNMPv3
    tags:
      - idrac-snmp-settings
