@jagged geyser this is the task I ended up using. I was trying to create a user for ONTAP Tools for VMware vSphere and don't want to give it the admin role, so was creating a specific role with the permissions required for OTV.
- name: Create OTV ONTAP Role netapp.ontap.na_ontap_ssh_command: <<: *clusterlogin command: "set -privilege diagnostic; security login role create -role {{ vsc_ontap_role }} -access {{ item.access }} -cmddirname {{ item.path }}" privilege: diagnostic accept_unknown_host_keys: true with_items: "{{ vsc_role_permissions }}" when: - vsc_ontap_role | default (false) - vsc_role_permissions | default (false) - add_cluster_to_otv | default(false) tags: otv_role
The {{ vsc_role_permissions }} variable looks like this:
vsc_role_permissions: - { path: '"DEFAULT"', access: none } - { path: '"cluster application-record create"', access: all } - { path: '"cluster application-record delete"', access: all } - { path: '"cluster application-record modify"', access: all } - { path: '"cluster application-record show"', access: all } - { path: '"cluster identity modify"', access: all } - { path: '"cluster identity show"', access: all } - { path: '"cluster modify"', access: all } - { path: '"cluster peer show"', access: all } - { path: '"cluster show"', access: all } - { path: '"job"', access: all } - { path: '"lun comment"', access: all } - { path: '"lun create"', access: all } - { path: '"lun delete"', access: all } - { path: '"lun geometry"', access: readonly } - { path: '"lun igroup add"', access: all }
And so on ...
I really wish there was an API to import the OTV Role json file that you can via System Manager, and you could just call that API and specify the json file. I did look but couldn't find one. Perhaps there is one somewhere.