<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting &amp;quot;User is not authorized.&amp;quot; for any ansible module tried in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/Getting-quot-User-is-not-authorized-quot-for-any-ansible-module-tried/m-p/466726#M45362</link>
    <description>&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;We are using ONTAP&amp;nbsp;Version 9.16.1P9.&lt;/DIV&gt;&lt;DIV&gt;When we try any Ansible tasks, example:&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;- name: Gather information test
  netapp.ontap.na_ontap_rest_info:
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    validate_certs: false
    gather_subset:
      - storage/qtrees
  register: qtrees_info&lt;/LI-CODE&gt;&lt;DIV&gt;We are getting this error:&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;"msg": {
    "code": "6691623",
    "message": "User is not authorized."
},&lt;/LI-CODE&gt;&lt;DIV&gt;However:&lt;/DIV&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;The ONTAP user is configured with the default vsadmin role (traditional role).&lt;/LI&gt;&lt;LI&gt;A direct REST call using the same credentials (for example GET /api/storage/qtrees) works correctly outside of Ansible.&lt;/LI&gt;&lt;LI&gt;The 401 Unauthorized (code 6691623) error occurs only when using the Ansible modules (na_ontap_rest_info, na_ontap_qtree).&lt;/LI&gt;&lt;LI&gt;Password has been vaulted with and without new line at the end.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Account is set like this:&lt;/P&gt;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;                                                                 Second
User/Group                 Authentication                 Acct   Authentication
Name           Application Method        Role Name        Locked Method
-------------- ----------- ------------- ---------------- ------ --------------
vsadmin        http        password      vsadmin          no     none
vsadmin        ontapi      password      vsadmin          no     none
vsadmin        ssh         password      noaccess         no     none
3 entries were displayed.​&lt;/LI-CODE&gt;&lt;DIV&gt;Does someone have an idea?&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance,&lt;/DIV&gt;</description>
    <pubDate>Mon, 13 Apr 2026 13:59:24 GMT</pubDate>
    <dc:creator>Mickos</dc:creator>
    <dc:date>2026-04-13T13:59:24Z</dc:date>
    <item>
      <title>Getting "User is not authorized." for any ansible module tried</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Getting-quot-User-is-not-authorized-quot-for-any-ansible-module-tried/m-p/466726#M45362</link>
      <description>&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;We are using ONTAP&amp;nbsp;Version 9.16.1P9.&lt;/DIV&gt;&lt;DIV&gt;When we try any Ansible tasks, example:&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;- name: Gather information test
  netapp.ontap.na_ontap_rest_info:
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    validate_certs: false
    gather_subset:
      - storage/qtrees
  register: qtrees_info&lt;/LI-CODE&gt;&lt;DIV&gt;We are getting this error:&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;"msg": {
    "code": "6691623",
    "message": "User is not authorized."
},&lt;/LI-CODE&gt;&lt;DIV&gt;However:&lt;/DIV&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;The ONTAP user is configured with the default vsadmin role (traditional role).&lt;/LI&gt;&lt;LI&gt;A direct REST call using the same credentials (for example GET /api/storage/qtrees) works correctly outside of Ansible.&lt;/LI&gt;&lt;LI&gt;The 401 Unauthorized (code 6691623) error occurs only when using the Ansible modules (na_ontap_rest_info, na_ontap_qtree).&lt;/LI&gt;&lt;LI&gt;Password has been vaulted with and without new line at the end.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Account is set like this:&lt;/P&gt;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;                                                                 Second
User/Group                 Authentication                 Acct   Authentication
Name           Application Method        Role Name        Locked Method
-------------- ----------- ------------- ---------------- ------ --------------
vsadmin        http        password      vsadmin          no     none
vsadmin        ontapi      password      vsadmin          no     none
vsadmin        ssh         password      noaccess         no     none
3 entries were displayed.​&lt;/LI-CODE&gt;&lt;DIV&gt;Does someone have an idea?&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance,&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Apr 2026 13:59:24 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Getting-quot-User-is-not-authorized-quot-for-any-ansible-module-tried/m-p/466726#M45362</guid>
      <dc:creator>Mickos</dc:creator>
      <dc:date>2026-04-13T13:59:24Z</dc:date>
    </item>
  </channel>
</rss>

