A significant portion of provisioning time is spent creating users in our AWS runner image. We have moved the user creation process for the `ubuntu` user, which is the default user in AWS EC2, and the `runneradmin` user to the image generation process. This approach eliminates the overhead of creating a user home directory every time we start a new instance. Squiggly HEREDOC "<<~" strips the leading whitespace. We can indent the commands for better readability. cloudinit does not apply most of the provided configuration if the user already exists. Similarly, if the user directory already exists, we do not create a home directory again and only set the SSH public keys. Ref: https://cloudinit.readthedocs.io/en/latest/reference/examples.html Note: Most of these configuration options will not be honored if the user already exists. Following options are the exceptions and they are applicable on already-existing users: - 'plain_text_passwd', 'hashed_passwd', 'lock_passwd', 'sudo', 'ssh_authorized_keys', 'ssh_redirect_user'.
8.9 KiB
8.9 KiB