Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions cloudinit/distros/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ def get_default_user(self):
def add_user(self, name, **kwargs):
"""
Add a user to the system using standard GNU tools

This should be overriden on distros where useradd is not desirable or
not available.
"""
# XXX need to make add_user idempotent somehow as we
# still want to add groups or modify SSH keys on pre-existing
Expand Down Expand Up @@ -520,9 +523,22 @@ def add_snap_user(self, name, **kwargs):

def create_user(self, name, **kwargs):
"""
Creates users for the system using the GNU passwd tools. This
will work on an GNU system. This should be overriden on
distros where useradd is not desirable or not available.
Creates or partially updates the ``name`` user in the system.

This defers the actual user creation to ``self.add_user`` or
``self.add_snap_user``, and most of the keys in ``kwargs`` will be
processed there if and only if the user does not already exist.

Once the existence of the ``name`` user has been ensured, this method
then processes these keys (for both just-created and pre-existing
users):

* ``plain_text_passwd``
* ``hashed_passwd``
* ``lock_passwd``
* ``sudo``
* ``ssh_authorized_keys``
* ``ssh_redirect_user``
"""

# Add a snap user, if requested
Expand Down