ansible-collections / netapp.ontap

Ansible collection to support NetApp ONTAP configuration.
https://galaxy.ansible.com/netapp/ontap
GNU General Public License v3.0
55 stars 35 forks source link

netapp.ontap.na_ontap_cifs_server sets service_state to stopped (down) by default. #121

Closed peterson342 closed 1 year ago

peterson342 commented 1 year ago

Summary

We found that if service_state is not set and other options like use_ldaps or encrypt_dc_connection (both added in 9.10) are set to change their state, service_state defaults to stopped (down). Reading the ansible-doc, I would have expected (maybe erroneously?) that service_state would not change if not specified. This happened in tests for both of the options listed above. If servcice_state is set to started while changing the other parameters, it remained started (didn't check stopped).

Is this expected behavior? If so, might be best to change the ansible-doc?

Thanks!

Component Name

netapp.ontap.na_ontap_cifs_server

Ansible Version

$bash-4.4#  ansible --version
ansible [core 2.13.5]
  config file = /runner/ansible.cfg
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  ansible collection location = /runner/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.13 (default, Jun 24 2022, 15:27:57) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)]
  jinja version = 3.1.2
  libyaml = True

ONTAP Collection Version

$netapp.ontap              21.24.1

ONTAP Version

NetApp Release 9.10.1P4: Mon May 09 22:11:44 UTC 2022

Playbook

Here's the task we're running.  item[0] is the cluster, item[1] is the SVM.
    - name: MODIFY VSERVER CIFS SECURITY SETTINGS
      netapp.ontap.na_ontap_cifs_server:
        hostname: "{{ item[0] }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
        https: true
        use_rest: always
        validate_certs: false
        vserver: "{{ item[1] }}"
        state: present
        name: "{{ item[1] }}"
        use_ldaps: true
        # encrypt_dc_connection: true
      loop: "{{ cifs_server_list }}"

Steps to Reproduce

Below are the state before, what is being changed, and state after. You'll note that whenever the option use-ldaps-for-ad-ldap is changed the admin state becomes down (stopped).

  1. status-admin: up, use-ldaps-for-ad-ldap true, no changes , result: status-admin: up, use-ldaps-for-ad-ldap true, CIFS server still up

  2. status-admin up, use-ldaps-for-ad-ldap false, change use-ldaps-for-ad-ldap to true : result: status-admin down, use-ldaps-for-ad-ldap true

  3. status-admin up, use-ldaps-for-ad-ldap true, change use-ldaps-for-ad-ldap to false: result: status-admin down, use-ldaps-for-ad-ldap false

  4. status-admin up, use-ldaps-for-ad-ldap false, no change: result: status-admin up, use-ldaps-for-ad-ldap false, CIFS server still up

Expected Results

See steps to reproduce.

Actual Results

See steps to reproduce.
lonico commented 1 year ago

DEVOPS-5677

carchi8py commented 1 year ago

This was fixed in 22.1.0 which was released last week.