#Hi I m not sure if this has been
1 messages · Page 1 of 1 (latest)
"module_stderr": "Traceback (most recent call last):\n File \"/home/ubuntu/.ansible/tmp/ansible-tmp-1660230289.6578023-16327-237689560654626/AnsiballZ_na_ontap_ldap_client.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/ubuntu/.ansible/tmp/ansible-tmp-1660230289.6578023-16327-237689560654626/AnsiballZ_na_ontap_ldap_client.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/ubuntu/.ansible/tmp/ansible-tmp-1660230289.6578023-16327-237689560654626/AnsiballZ_na_ontap_ldap_client.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.netapp.ontap.plugins.modules.na_ontap_ldap_client', init_globals=dict(_module_fqn='ansible_collections.netapp.ontap.plugins.modules.na_ontap_ldap_client', _modlib_path=modlib_path),\n File \"/usr/lib/python3.10/runpy.py\", line 209, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_netapp.ontap.na_ontap_ldap_client_payload_u5dfi51h/ansible_netapp.ontap.na_ontap_ldap_client_payload.zip/ansible_collections/netapp/ontap/plugins/modules/na_ontap_ldap_client.py\", line 547
in main\n File \"/tmp/ansible_netapp.ontap.na_ontap_ldap_client_payload_u5dfi51h/ansible_netapp.ontap.na_ontap_ldap_client_payload.zip/ansible_collections/netapp/ontap/plugins/modules/na_ontap_ldap_client.py\", line 529, in apply\n File \"/tmp/ansible_netapp.ontap.na_ontap_ldap_client_payload_u5dfi51h/ansible_netapp.ontap.na_ontap_ldap_client_payload.zip/ansible_collections/netapp/ontap/plugins/module_utils/netapp_module.py\", line 279, in get_modified_attributes\n File \"/tmp/ansible_netapp.ontap.na_ontap_ldap_client_payload_u5dfi51h/ansible_netapp.ontap.na_ontap_ldap_client_payload.zip/ansible_collections/netapp/ontap/plugins/module_utils/netapp_module.py\", line 239, in compare_lists\nAttributeError: 'str' object has no attribute 'remove'\n",
This is generated running a simple task such as ```#Configures LDAP on FSx
- name: Create LDAP client
netapp.ontap.na_ontap_ldap_client:
state: present
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
vserver: "{{ vserver_name }}"
validate_certs: no
https: true
name: "{{ ldap_client_name }}"
ldap_servers: "{{ ldap_server_name }}"
base_dn: "dc=mydc,dc=com"
schema: "RFC-2307"
tcp_port: "636"
base_scope: "subtree"
min_bind_level: "anonymous"
query_timeout: 3```
What version of the collection are you using?
'netapp.ontap:21.22.0'
Please run the following:
- Write a simple task to add an LDAP server
- Run
ansible-galaxy collection install netapp.ontap:==21.21.0 - Run the playbook (it will succeed)
- Run
ansible-galaxy collection install netapp.ontap:==21.22.0 - Rerun your playbook (it will fail)
It's definitely broken in the collection. I'm not sure if other modules are broken, I haven't done enough research
Checking in on this
@raven forum were you able to reproduce this?
@cosmic lotus can you run the playbook again with -vvv and send me the output.
I created a similar playbook with the same options but didn't get an error.
There may be an issue with ldap_servers. The module expects a list of strs, not a str. If you pass a str directly in the play, Ansible will convert it. But with variable substitution, they are handled as is. It maybe enough to add a line with a - and the variable.
Just as an FYI, I'm also seeing this in my lab w/ ref to ldap_servers. It's taking each char as an LDAP server
How is the variable defined?
originally it was in-line. I had tried a few variations "192.168.0.253" 192.168.0.253
Tried the hostname as well dc1.demo.domain.com. I realized it was taking individual characters as strings when I tried just DC1 and it took but the LDAP servers were defined as D, C, 1 in the ldap client show
Falling back to the old collection allowed it to work as expected
We need to get a deeper look into this. We added REST support when switching from 21.21.0 to 21.22.0. So you may be able to toggle the behavior by setting use_rest to always to force REST or never to force ZAPI. But looking at the code, I don't see anything amiss. There is no manipulation of ldap_servers. Also, which version of ONTAP is used?
I was able to reproduce the issue with ZAPI. There is no issue with REST.
There is no issue using ldap_servers: ['ldap1.example.company.com'] or ldap_servers: - 'ldap1.example.company.com' but I see that ```
ldap_servers: 'ldap1.example.company.com'
Interesting bug. We have
servers:
description:
- Comma separated list of LDAP servers. FQDN's or IP addreses.
- Required if I(state=present).
type: list
elements: str
aliases: ['ldap_servers']
If we use servers, Ansible is doing the transformation into a list. But if we use ldap_servers, we het the native input. It's a bug in our side anyway, we should use the primary key, not the alias internally.
[WARNING]: INIT servers ['ldap1.example.company.com']
[WARNING]: INIT ldap_servers ldap1.example.company.com
And with ZAPI, the module will break if you attempt to use servers. We'll fix this ASAP, but a work-around is to explictly use a list using one of the two methods above.