summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcloudinit/distros/__init__.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 2fc91bbc..c7163e1c 100755
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -392,6 +392,9 @@ class Distro(metaclass=abc.ABCMeta):
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
@@ -520,9 +523,22 @@ class Distro(metaclass=abc.ABCMeta):
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