Terraform enterprise admin user creation not allowed

67 Views Asked by At

I am following below document to create initial admin user account via api call

https://developer.hashicorp.com/terraform/enterprise/replicated/install/automated/automating-initial-user

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?

1

There are 1 best solutions below

0
user312307 On

I figured out that admin account created from previous attempt was still there in db, deleted from rails console and it fixed the issue