#na_ontap_user Error since on REST

1 messages · Page 1 of 1 (latest)

dark compass
#

Playbook:

- hosts: localhost
  vars:
  ¦ user_applications: "{{ USER_APPLICATIONS }}"
  ¦ user_role: "{{ USER_ROLE }}"
  ¦ user_name: "{{ USER_NAME }}"
  ¦ user_pw: "{{ USER_PW }}"
  ¦ auth_method: "{{ AUTH_METHOD }}"
  ¦ filer: "{{ FILER | split}}"
  gather_facts: no
  tasks:
  ¦ - name: User modify
  ¦ ¦ include_role:
  ¦ ¦ ¦ name: create_user
  ¦ ¦ vars:
  ¦ ¦ ¦ netapp_fqdn: "{{ hostvars[item].cluster.netapp_fqdn }}"
  ¦ ¦ ¦ netapp_username: "{{ hostvars[item].netapp_ansiblelogin_commons.netapp_username }}"
  ¦ ¦ ¦ netapp_password: "{{ hostvars[item].netapp_ansiblelogin_commons.netapp_password }}"
  ¦ ¦ ¦ vserver_name: ""
  ¦ ¦ loop: "{{ filer }}"
  ¦ ¦ ignore_errors: yes
...

Role:

- name: Create User
  netapp.ontap.na_ontap_user:
  ¦ state: present
  ¦ name: "{{ user_name }}"
  ¦ applications: "{{ user_applications }}"
  ¦ authentication_method: "{{ auth_method }}"
  ¦ set_password: "{{ user_pw }}"
  ¦ lock_user: False
  ¦ role_name: "{{ user_role }}"
  ¦ vserver: "{{ vserver_name }}"
  ¦ hostname: "{{ netapp_fqdn }}"
  ¦ username: "{{ netapp_username }}"
  ¦ password: "{{ netapp_password }}"
  ¦ https: true
  ¦ use_rest: always
  ¦ validate_certs: false
  ignore_errors: yes

Returns:

fatal: [localhost]: FAILED! => changed=false
  msg: 'Error while fetching user info: {''message'': ''The expression is missing a value'', ''code'': ''262194'', ''target'': ''owner.name''}'

What are wo doing wrong?

rare whale
#

Your passing in `` as vserver name

#

Hmmm one sec let me double check i think this is a bug

#

I've created DEVOPS-6005 for this issue

sharp jacinth
#

@dark compass
set vserver with no value to manage cluster scoped users.

vserver:
vserver: '' still means empty string

- name: Create User in cluster scope in REST. netapp.ontap.na_ontap_user: state: present name: SampleUser applications: ssh,console authentication_method: password set_password: apn1242183u1298u41 lock_user: True role_name: vsadmin vserver: hostname: "{{ netapp_hostname }}" username: "{{ netapp_username }}" password: "{{ netapp_password }}"

rare whale
#

can we document that better in the documnetation

#

i took that as "" as well

dark compass
#

Thank you alll. Will try it later today and report.

dark compass
#

It works. Thank you for the clarification.

dark compass
sharp jacinth
#

vserver is a required field, {{ omit }} actually removes the vserver.

dark compass