Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## what This: * Removes unnecessary `sudo` commands since the [user-data script runs as the root user](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts). * Adds waiting for the RPM lock to be released. * We've seen the following logs during an instance start-up: ```sh user-data: RPM: error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Resource temporarily unavailable) user-data: The downloaded packages were saved in cache until the next successful transaction. user-data: You can remove cached packages by executing 'yum clean packages'. user-data: Error: Could not run transaction. ``` * RPM database lock is being held by another process when script attempts to run yum/dnf commands. Amazon Linux 2023 (AL2023) may perform automatic updates or other package management tasks during boot, causing the RPM database to be locked temporarily. * Uses `dnf` instead of yum: Amazon Linux 2023 [uses dnf as the default package manager](https://docs.aws.amazon.com/linux/al2023/ug/package-management.html). `dnf` is the successor to `yum`. ## why * Prevents RPM lock issue and follows AWS recommended practices. ## references * N/A <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated script for Tailscale installation and configuration, improving efficiency with a retry mechanism for command execution. - **Bug Fixes** - Removed unnecessary `sudo` calls for a cleaner execution process. - **Documentation** - Enhanced readability of the `ssm_state_enabled` variable description in the configuration file. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information