---
- name: Configure iDRAC syslog attributes
  hosts: idrac
  gather_facts: false

  tasks:
    - name: Enable idrac basic syslog
      dellemc.openmanage.idrac_attributes:
        idrac_ip: "192.168.0.1"
        idrac_user: "user_name"
        idrac_password: "user_password"
        ca_path: "/path/to/ca_cert.pem"
        idrac_attributes:
          SysLog.1.SysLogEnable: Enabled
          SysLog.1.Server1: 192.168.0.2
          SysLog.1.Server2: 192.168.0.3
          SysLog.1.Server3: 192.168.0.4
          SysLog.1.Port: 514

    - name: Disable idrac basic syslog
      dellemc.openmanage.idrac_attributes:
        idrac_ip: "192.168.0.1"
        idrac_user: "user_name"
        idrac_password: "user_password"
        ca_path: "/path/to/ca_cert.pem"
        idrac_attributes:
          SysLog.1.SysLogEnable: Disabled

    - name: Enable idrac secure syslog
      dellemc.openmanage.idrac_attributes:
        idrac_ip: "192.168.0.1"
        idrac_user: "user_name"
        idrac_password: "user_password"
        ca_path: "/path/to/ca_cert.pem"
        idrac_attributes:
          SysLog.1.securesyslogenable: Enabled
          SysLog.1.secureserver1: 192.168.0.2
          SysLog.1.secureport: 6511
          SysLog.1.secureclientauth: Anonymous

    - name: Disable idrac secure syslog
      dellemc.openmanage.idrac_attributes:
        idrac_ip: "192.168.0.1"
        idrac_user: "user_name"
        idrac_password: "user_password"
        ca_path: "/path/to/ca_cert.pem"
        idrac_attributes:
          SysLog.1.securesyslogenable: Disabled
