Closed CledersonE closed 1 month ago
Hi @CledersonE ,
Thank you for raising this question. I’ve tested your script on my end, and everything seems to be functioning correctly. From the debug messages, it appears that the issue arises at the set accprofile "super_admin"
line. One possible explanation could be that the API user credentials you’re using might not have sufficient permissions to create an admin user with the "super_admin" accprofile. The "super_admin" profile has the highest level of permissions, and even if you create an accprofile with full read/write permissions, some operations might still be restricted.
Could you kindly review your API user settings? If the issue continues, please let me know your FOS version, and I’ll be happy to test it with that information.
config system api-user
edit "api"
set api-key ENC SH209Bx5uJzXLrfT4O+9ZB62KW1rG5BXaCCtjUoMC6z6eRxehE3PqiuIsbexHc=
set accprofile "super_admin"
next
end
Thanks, Maxx
Hi @MaxxLiu22, Thank you very much for the quick response. You nail it. Indeed, I was creating a separate accprofile for my API users since from the GUI you can't create an rest_api user and add the super_admin profile. As a result, I've created a new accprofil, granted all the permissions and thought that would work as the super_admin (I didn't know that despite you add all the permissions, the super_admin would have more ones). Once I've changed my API user to the super_admin, I was able to create the new admin user with the Ansible playbook.
Once again, thank you very much for your support!
I'm trying to create a simple admin user in a lab environment using the fortios_system_admin module and I'm facing issues. I've already look at examples from other issues such as 126 and 20 but still I'm not able to create the user. Here is the playbook and the logs from Fortigate:
Playbook:
FortiGate logs:
In addition, I tried to create the same user using the FortiGate cli and it works without any problem:
Am I doing something wrong or missing anything on the creation? The collection that I'm using is
fortinet.fortios 2.3.7