Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idempotency issue with admin user on final step #14

Open
ldelelis opened this issue Mar 30, 2021 · 0 comments
Open

Idempotency issue with admin user on final step #14

ldelelis opened this issue Mar 30, 2021 · 0 comments

Comments

@ldelelis
Copy link

Re-applying the role to a host in which it already was applied with bastion_create_admin: true causes its final step to fail, erroring about the admin account already existing.

Step execution logs:

TASK [adamsbytes.ovhbastion : complete initial account setup] *********************************
fatal: [redacted]: FAILED! => changed=true
  cmd: /opt/bastion/bin/admin/setup-first-admin-account.sh [redacted]-admin auto
  delta: '0:00:00.370691'
  end: '2021-03-30 13:23:18.470109'
  msg: non-zero return code
  rc: 100
  start: '2021-03-30 13:23:18.099418'
  stdout: |-
    [1;34m---s1-4-us-east-va-1--------------------------------------the-bastion-3.03.00---
    [0m[34m=> create a new bastion account
    [0m[34m--------------------------------------------------------------------------------
    [0m[34m~ [0mPlease paste the SSH key you want to add. This bastion supports the following algorithms:
    [34m~ [0mED25519: strongness[#####] speed[#####], use `ssh-keygen -t ed25519' to generate one
    [34m~ [0mECDSA  : strongness[####.] speed[#####], use `ssh-keygen -t ecdsa -b 521' to generate one
    [34m~ [0mRSA    : strongness[###..] speed[#....], use `ssh-keygen -t rsa -b 4096' to generate one
    [34m~ [0m
    [34m~ [0mIn any case, don't save it without a passphrase (your paste won't be echoed).

    [31;1m~ The account [redacted]-admin already exists[0m
    [1;34m-------------------------------------------------------------</accountCreate>---
    [0m
  stdout_lines: <omitted>

Would adding an extra check for a UNIX user matching the admin name be a good idea to avoid this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant