Enhance first-boot script and documentation with config file support
Introduce a configuration file (`first-boot.conf`) to allow users to override default script variables without modifying the script directly. Update the first-boot script to load this config file from multiple locations, enhancing flexibility in customization. Revise documentation to guide users on how to utilize the config file for setting variables like FILE_SERVER, HOSTNAME, and PACKAGES, improving the overall user experience during first boot operations.
This commit is contained in:
@@ -6,7 +6,10 @@
|
||||
# 1. Generate a password hash: mkpasswd -m sha-512 'YourPassword' or openssl passwd -6 'YourPassword'
|
||||
# Paste the full output into the passwd: line below.
|
||||
# 2. Host first-boot.sh (same dir as this repo: cloud-init/first-boot.sh) at FIRST_BOOT_URL.
|
||||
# 3. To use a different username than "pi", replace every "pi" in this file and in first-boot.sh.
|
||||
# 3. Optional: copy first-boot.conf.example to first-boot.conf, edit variables, and host it
|
||||
# as first-boot.conf; then add a runcmd line to download it to /tmp/first-boot.conf before
|
||||
# running first-boot.sh so the script loads your config.
|
||||
# 4. To use a different username than "pi", set PI_USER in first-boot.conf and create that user below.
|
||||
|
||||
package_update: true
|
||||
package_upgrade: false
|
||||
@@ -31,7 +34,9 @@ runcmd:
|
||||
- systemctl enable ssh
|
||||
- systemctl start ssh
|
||||
- curl -fsSL "http://10.20.50.1:5000/files/first-boot.sh" -o /tmp/first-boot.sh
|
||||
# Optional: download config to override FILE_SERVER, HOSTNAME, PACKAGES, etc.
|
||||
# - curl -fsSL "http://10.20.50.1:5000/files/first-boot.conf" -o /tmp/first-boot.conf
|
||||
- chmod +x /tmp/first-boot.sh
|
||||
- /tmp/first-boot.sh
|
||||
# - rm -f /tmp/first-boot.sh
|
||||
# - rm -f /tmp/first-boot.sh /tmp/first-boot.conf
|
||||
- cloud-init single --name cc_final_message
|
||||
|
||||
Reference in New Issue
Block a user