#Clearing value of Autosupport SMTP

1 messages · Page 1 of 1 (latest)

obtuse oxide
#

I'm currently setting Autosupport options to HTTPS instead of SMTP and would like to remove the options previously configured for SMTP.
What value do I specify to remove them?

from_address: ""

I've tried with "", " " and "-" but all give me an error like this, expecting an email address I guess:
FAILED! => {"changed": false, "msg": "Error modifying asup: calling: private/cli/system/node/autosupport: got {'message': '\" \" is an invalid value for field \"from\" (<Mail Address>)', 'code': '2', 'target': 'from'}."}

wraith barn
#

I think from_address can only be "Postmaster" or a valid email string
not an empty value

violet birch
obtuse oxide
obtuse oxide
#

Got any input here, @violet birch ?

violet birch
#

Hey sorry i was on vacation. Could you send me the commnd you run to do this

obtuse oxide
# violet birch Hey sorry i was on vacation. Could you send me the commnd you run to do this

No worries! I mean clearing settings in general but perhaps this is a special case, here's the Task I run (that fails):

    netapp.ontap.na_ontap_autosupport:
      transport: https
      # proxy_url: "{{ proxy_url_concat }}"
      node_name: "{{ node_info.ontap_info.cluster_nodes.records[0].name }}"
      ondemand_enabled: false
      support: true
      private_data_removed: true
      perf_data_enabled: false  # Can't be true if "private_data_removed" is true
      validate_digital_certificate: true

      # Clear settings for SMTP
      from_address:
      hostname_in_subject: false
      mail_hosts:
      noteto:
      partner_addresses:
      to_addresses:
    connection: local```
obtuse oxide
#

@violet birch Any thoughts?

violet birch
#

What the value of from address?

obtuse oxide
raw plinth
obtuse oxide
# raw plinth You can simply leave the variable like below- from_address: Then use the below...

Do you mean something like this?

  - set_fact:
      empty:

  - name: Configure Autosupport
    netapp.ontap.na_ontap_autosupport:
      transport: https
      # proxy_url: "{{ proxy_url_concat }}"
      node_name: "{{ node_info.ontap_info.cluster_nodes.records[0].name }}"
      ondemand_enabled: false
      support: true
      private_data_removed: true
      perf_data_enabled: false  # Can't be true if "private_data_removed" is true
      validate_digital_certificate: true

      # Clear settings for SMTP
      from_address: "{{ empty | default(omit) }}"
      hostname_in_subject: false
      mail_hosts: "{{ empty | default(omit) }}"
      noteto: "{{ empty | default(omit) }}"
      partner_addresses: "{{ empty | default(omit) }}"
      to_addresses: "{{ empty | default(omit) }}"
    connection: local      # Important since we are using the module to connect to the clusters```

This results in:
*FAILED! => {"changed": false, "msg": "Error modifying asup: calling: private/cli/system/node/autosupport: got {'message': 'failed to set field \"noteto[0]\" to \"\"', 'code': '2', 'target': 'noteto[0]'}."}*

If I comment out the "noteto" line the error becomes:
*FAILED! => {"changed": false, "msg": "Error modifying asup: calling: private/cli/system/node/autosupport: got {'message': '\"\" is an invalid value for field \"from\" (<Mail Address>)', 'code': '2', 'target': 'from'}."}*
#

Just tried this with CLI but with same result, so perhaps there is no way to clear these values?


Error: "" is an invalid value for field "-from <Mail Address>"```
#

Clearing value of Autosupport SMTP

obtuse oxide
#

I played around with it some more and found that the default value for "mail-hosts" and "from" are "mailhost" and "Postmaster" which works to set again.
The values of "to" and "partner-address" is expected to be an array, so "[]" worked.
This is my Task now for anyone looking for the answer to this:

- name: Configure Autosupport
    netapp.ontap.na_ontap_autosupport:
      transport: https
      # proxy_url: "{{ proxy_url_concat }}"
      node_name: "{{ node_info.ontap_info.cluster_nodes.records[0].name }}"
      ondemand_enabled: false
      support: true
      private_data_removed: true
      perf_data_enabled: false  # Can't be true if "private_data_removed" is true
      validate_digital_certificate: true

      # Clear settings for SMTP
      from_address: "Postmaster"
      hostname_in_subject: false
      mail_hosts: "mailhost"
      # noteto: ""        # Deprecated
      partner_addresses: []
      to_addresses: []
    connection: local     # Important since we are using the module to connect to the clusters
raw plinth
violet birch
#

Since it an optional varabile if you want to leave it blank don't include it in your playbook.

obtuse oxide
obtuse oxide