Usermod: user 'xxx' does not exist in /etc/passwd when running server playbook

Hi guys,

When trying to provision my server it’s failing with this error:

usermod: user ‘XXX’ does not exist in /etc/passwd on TASK [users : Setup users]

Any ideas? In users.yml I have changed the admin_user to ‘XXX’

The server has my correct public key added to it. Another question, if my public key has been added to a server and I can login it using the key and not a password, why does the admin_user password need to be added to vault_users for the respective host?

Many thanks!

The password is not intended for authentication during SSH connection. Rather, it is used when invoking sudo. Think of it as the user’s sudo password.

I don’t think I’ve ever seen this one with Trellis before. I suspect you have a non-standard setup related to users. If you’ve made some user adjustments manually, you may need to…

  • dig in to diagnose the situation and manually make more changes
  • or just spin up a replacement server. I realize that’s less easy if this is production.

On the other hand, perhaps you are using some kind of distributed authentication or LDAP, etc. Maybe some of the notes at these links will give you some ideas: