# Module nxos\_user not recognizing fails saying role is invalid

**URL:** <https://forum.ansible.com/t/module-nxos-user-not-recognizing-fails-saying-role-is-invalid/29642>\
**Category:** Ansible Project\
**Created:** [February 8, 2019, 5:39pm UTC](https://forum.ansible.com/t/module-nxos-user-not-recognizing-fails-saying-role-is-invalid/29642 "2019-02-08T17:39:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eliezer\_Rodriguez](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@Eliezer\_Rodriguez](https://forum.ansible.com/u/Eliezer_Rodriguez)\
**Post date:** [February 8, 2019, 5:39pm UTC](https://forum.ansible.com/t/module-nxos-user-not-recognizing-fails-saying-role-is-invalid/29642/1 "2019-02-08T17:39:55Z")

</div>

Hi everybody,

I wrote this playbook to create a new role in Nexus OS and then create a new user to use that role.  
The role gets created but when it’s time for the second task to create the role it fails with a non-existent role error.

---

<div class="post-metadata">

**Author:** ![Alex\_King](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@Alex\_King](https://forum.ansible.com/u/Alex_King)\
**Post date:** [February 12, 2020, 10:13pm UTC](https://forum.ansible.com/t/module-nxos-user-not-recognizing-fails-saying-role-is-invalid/29642/2 "2020-02-12T22:13:17Z")

</div>

I had the same problem. It seem like it is a shortcoming of the nxos\_user module. It seems like roles are checked against a hard-coded list of standard roles, and the module can’t work with user defined roles at all.

Thanks,  
Alex

---

<div class="post-metadata">

**Author:** ![Eliezer\_Rodriguez](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@Eliezer\_Rodriguez](https://forum.ansible.com/u/Eliezer_Rodriguez)\
**Post date:** [March 10, 2020, 6:06pm UTC](https://forum.ansible.com/t/module-nxos-user-not-recognizing-fails-saying-role-is-invalid/29642/3 "2020-03-10T18:06:55Z")

</div>

Got it ! Thanks Alex for taking the time to respond !

Elie
