I am following below document to create initial admin user account via api call
I am making curl call via ansible as below
- name: Create initial site-admin account
uri:
url: "https://{{ hostname }}/admin/initial-admin-user?token={{ iact.stdout }}"
method: POST
body_format: json
body:
username: "{{ tfe_admin_user_name }}"
password: "{{ tfe_admin_user_password }}"
email: "{{ admin_email }}"
validate_certs: no
#no_log: True
register: createadmin
But it throws me below error:
{"error": "admin user creation not allowed", "status": "error"}, "msg": "Status code was 401 and not [200]: HTTP Error 401: Unauthorized"
Has someone seen this issue?
I figured out that admin account created from previous attempt was still there in db, deleted from rails console and it fixed the issue