Good Day everyone,
First: I apologize if this thread if posted someplace else, I’ve looked but cannot find this particular issue…
I’m new to Ansible and configurations but I learn fairly quickly. I have been trying for hours to figure out which module and how to add the Administrator role to a newly created local user account on a VMWare host machine.
I’ve been able to figure out 90% of what I need so far, I just cannot figure out this piece.
This is what I have now…
- name: Add User Roles
community.vmware.vmware_local_role_manager:
hostname: "{{ esxi_host }}"
username: "{{ esxi_user }}"
password: "{{ esxi_password }}"
validate_certs: false
local_role_name: "Administrator"
principal: "{{ item.new_username }}"
state: present
loop: "{{ users }}"
delegate_to: localhost
Edit:
This is the error I’m getting:
TASK [Add User Roles] *****************************************************************************
failed: [10.10.10.176 → localhost] (item={‘new_username’: ‘Armory’, ‘password’: ‘P@ssw0rd1!’, ‘description’: ‘Armory Staff’, ‘role’: ‘Admin’}) => {“ansible_loop_var”: “item”, “changed”: false, “item”: {“description”: “Armory Staff”, “new_username”: “Armory”, “password”: “P@ssw0rd1!”, “role”: “Admin”}, “msg”: “Unsupported parameters for (community.vmware.vmware_local_role_manager) module: principal. Supported parameters include: action, force_remove, hostname, local_privilege_ids, local_role_name, password, port, proxy_host, proxy_port, state, username, validate_certs (admin, pass, pwd, user).”}
failed: [10.10.10.176 → localhost] (item={‘new_username’: ‘Support’, ‘password’: ‘KJHC@!#!CAWlkjasc’, ‘description’: ‘Support Staff’, ‘role’: ‘Admin’}) => {“ansible_loop_var”: “item”, “changed”: false, “item”: {“description”: “Support Staff”, “new_username”: “Support”, “password”: “KJHC@!#!CAWlkjasc”, “role”: “Admin”}, “msg”: “Unsupported parameters for (community.vmware.vmware_local_role_manager) module: principal. Supported parameters include: action, force_remove, hostname, local_privilege_ids, local_role_name, password, port, proxy_host, proxy_port, state, username, validate_certs (admin, pass, pwd, user).”}
I’ve also tried with the community.vmware.vmware_object_role_permission module… I just can’t seem to figure it out and when I search online, it pulls up EVERYTHING except what I’m looking for…
I just need a little help.
Thanks,
Nate