mirror of
https://github.com/rancher/os.git
synced 2025-09-09 02:31:36 +00:00
add cloud-init support
This commit is contained in:
3
scripts/dockerimages/04-cloudconfig
Normal file
3
scripts/dockerimages/04-cloudconfig
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM base
|
||||
COPY scripts/dockerimages/scripts/cloud-config.sh /
|
||||
CMD ["/cloud-config.sh"]
|
7
scripts/dockerimages/scripts/cloud-config.sh
Executable file
7
scripts/dockerimages/scripts/cloud-config.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x -e
|
||||
|
||||
CLOUD_CONFIG_FLAGS=$(rancherctl config get cloud_config)
|
||||
|
||||
cloudinit --preinit "$CLOUD_CONFIG_FLAGS"
|
@@ -3,6 +3,12 @@
|
||||
#if [ -t 1 ]; then
|
||||
#exec /bin/sh
|
||||
#else
|
||||
|
||||
CLOUD_CONFIG_FILE=/var/lib/rancher/cloud-config
|
||||
|
||||
if [ -s $CLOUD_CONFIG_FILE ]; then
|
||||
cloudinit --from-file $CLOUD_CONFIG_FILE
|
||||
fi
|
||||
exec respawn << EOF
|
||||
/sbin/getty 115200 tty1
|
||||
/sbin/getty 115200 tty2
|
||||
|
Reference in New Issue
Block a user