fix(user_management): hand back to the created user and refuse a mismatched fallback
The handback switched the connection to ansible_user, while the role creates user_management_ansible_user.name. When the two differed, the root fallback created a user nobody connects as, and the handback then failed after the changes made as root, or later plays connected as the wrong user. The fallback now asserts, before switching to root, that the primary user's name equals ansible_user (set as a variable), and the handback switches to the user the role created. No change where the names are equal (the default). Also name user_management as a user of ansible.posix in the galaxy.yml comment. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
da87a7e141
commit
ce537fc6b4
5 files changed
+20
-4
No files matched your search
@@ -3,5 +3,6 @@ minor_changes:
|
||||
- user_management - New role. Manages the primary ansible user and additional users (a user with ``state=absent`` is removed),
|
||||
their ``authorized_keys`` (exclusive by default), sudo and cloud-init. When the configured user cannot connect (a
|
||||
fresh guest) it falls back to root with the same deploy key, never a password, and hands the connection back to
|
||||
the configured user once it exists. The optional ``user_management_lock_root_password`` (default false) replaces
|
||||
the configured user once it exists; the fallback refuses to run when the primary user's name is not
|
||||
``ansible_user``. The optional ``user_management_lock_root_password`` (default false) replaces
|
||||
root's password hash with ``!`` and leaves root's keys and shell alone.
|
||||
Reference in new issue
Block a user