mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-15 11:22:43 +03:00
* default cloud configs per cloud
* network-interfaces --> assemble-interfaces * minor tweaks for subpackaging
This commit is contained in:
parent
761e986afb
commit
1b72c7ce69
@ -27,11 +27,6 @@ ip() {
|
||||
fi
|
||||
}
|
||||
|
||||
assemble_interfaces() {
|
||||
log info "Rebuilding $IFACE_CFG"
|
||||
/lib/tiny-cloud/network-interfaces
|
||||
}
|
||||
|
||||
interface_up() {
|
||||
log info "Bringing up $MDEV"
|
||||
# umask so udhcpc PID file isn't non-owner writeable
|
||||
@ -67,11 +62,11 @@ if exec 200>>"$IFACE_CFG"; then
|
||||
if flock 200; then
|
||||
case $ACTION in
|
||||
add|"")
|
||||
assemble_interfaces
|
||||
assemble-interfaces
|
||||
is_networking_started && interface_up
|
||||
;;
|
||||
remove)
|
||||
assemble_interfaces
|
||||
assemble-interfaces
|
||||
is_networking_started && cleanup_interface
|
||||
;;
|
||||
*)
|
||||
|
||||
30
lib/tiny-cloud/aws/tiny-cloud
Normal file
30
lib/tiny-cloud/aws/tiny-cloud
Normal file
@ -0,0 +1,30 @@
|
||||
# Tiny Cloud configuration
|
||||
|
||||
# REQUIRED: The instance's cloud provider (valid: aws, azure, gcp, oci)
|
||||
# valid: aws, azure, gcp, oci
|
||||
CLOUD=aws
|
||||
|
||||
# User account where instance SSH keys are installed
|
||||
#CLOUD_USER=alpine
|
||||
|
||||
# Filename of userdata file (in TINY_CLOUD_VAR directory)
|
||||
#CLOUD_USERDATA=user-data
|
||||
|
||||
# IMDS token validity, in seconds (AWS only)
|
||||
#IMDS_TOKEN_TTL=5
|
||||
|
||||
# Location of var directory
|
||||
#TINY_CLOUD_VAR=/var/lib/cloud
|
||||
|
||||
# Location of log directory
|
||||
#TINY_CLOUD_LOGS=/var/log
|
||||
|
||||
# Hotplug Method (valid: mdev)
|
||||
#HOTPLUG_TYPE=mdev
|
||||
|
||||
# Cloud-related Hotplug Modules
|
||||
# valid: vnic_eth_hotplug, nvme_ebs_links (aws)
|
||||
HOTPLUG_MODULES="
|
||||
vnic_eth_hotplug
|
||||
nvme_ebs_links
|
||||
"
|
||||
27
lib/tiny-cloud/azure/tiny-cloud
Normal file
27
lib/tiny-cloud/azure/tiny-cloud
Normal file
@ -0,0 +1,27 @@
|
||||
# Tiny Cloud configuration
|
||||
|
||||
# REQUIRED: The instance's cloud provider (valid: aws, azure, gcp, oci)
|
||||
# valid: aws, azure, gcp, oci
|
||||
CLOUD=azure
|
||||
|
||||
# User account where instance SSH keys are installed
|
||||
#CLOUD_USER=alpine
|
||||
|
||||
# Filename of userdata file (in TINY_CLOUD_VAR directory)
|
||||
#CLOUD_USERDATA=user-data
|
||||
|
||||
# IMDS token validity, in seconds (AWS only)
|
||||
#IMDS_TOKEN_TTL=5
|
||||
|
||||
# Location of var directory
|
||||
#TINY_CLOUD_VAR=/var/lib/cloud
|
||||
|
||||
# Location of log directory
|
||||
#TINY_CLOUD_LOGS=/var/log
|
||||
|
||||
# Hotplug Method (valid: mdev)
|
||||
#HOTPLUG_TYPE=mdev
|
||||
|
||||
# Cloud-related Hotplug Modules
|
||||
# valid: vnic_eth_hotplug, nvme_ebs_links (aws)
|
||||
#HOTPLUG_MODULES=
|
||||
27
lib/tiny-cloud/gcp/tiny-cloud
Normal file
27
lib/tiny-cloud/gcp/tiny-cloud
Normal file
@ -0,0 +1,27 @@
|
||||
# Tiny Cloud configuration
|
||||
|
||||
# REQUIRED: The instance's cloud provider (valid: aws, azure, gcp, oci)
|
||||
# valid: aws, azure, gcp, oci
|
||||
CLOUD=gcp
|
||||
|
||||
# User account where instance SSH keys are installed
|
||||
#CLOUD_USER=alpine
|
||||
|
||||
# Filename of userdata file (in TINY_CLOUD_VAR directory)
|
||||
#CLOUD_USERDATA=user-data
|
||||
|
||||
# IMDS token validity, in seconds (AWS only)
|
||||
#IMDS_TOKEN_TTL=5
|
||||
|
||||
# Location of var directory
|
||||
#TINY_CLOUD_VAR=/var/lib/cloud
|
||||
|
||||
# Location of log directory
|
||||
#TINY_CLOUD_LOGS=/var/log
|
||||
|
||||
# Hotplug Method (valid: mdev)
|
||||
#HOTPLUG_TYPE=mdev
|
||||
|
||||
# Cloud-related Hotplug Modules
|
||||
# valid: vnic_eth_hotplug, nvme_ebs_links (aws)
|
||||
#HOTPLUG_MODULES=
|
||||
@ -22,8 +22,6 @@ expand_root() {
|
||||
resize2fs "$mountpoint"
|
||||
}
|
||||
|
||||
assemble_interfaces() { /lib/tiny-cloud/network-interfaces; }
|
||||
|
||||
has_cloud_hotplugs() { [ -n "$HOTPLUG_MODULES" ]; }
|
||||
|
||||
install_hotplugs() {
|
||||
@ -40,4 +38,4 @@ install_hotplugs() {
|
||||
}
|
||||
|
||||
HOTPLUG_TYPE=${HOTPLUG_TYPE:-mdev}
|
||||
source /lib/tiny-cloud/"$HOTPLUG_TYPE"
|
||||
[ -f /lib/tiny-cloud/"$HOTPLUG_TYPE" ] && source /lib/tiny-cloud/"$HOTPLUG_TYPE"
|
||||
|
||||
@ -23,13 +23,15 @@ install_before() {
|
||||
|
||||
# hotpluggable VNICs (multi-cloud)
|
||||
mod__vnic_eth_hotplug() {
|
||||
[ -f /lib/mdev/vnic-eth-hotplug ] || return 1
|
||||
|
||||
install_before '^eth' \
|
||||
'eth[0-9] root:root 0644 */lib/mdev/vnic-eth-hotplug'
|
||||
|
||||
# NICs attached at launch don't get added with mdev -s
|
||||
assemble_interfaces
|
||||
assemble-interfaces
|
||||
}
|
||||
|
||||
# load cloud-specific functions
|
||||
|
||||
[ -f /lib/tiny-cloud/"$CLOUD"/mdev ] && source /lib/tiny-cloud/"$CLOUD"/mdev
|
||||
[ -f /lib/tiny-cloud/"$CLOUD"/mdev ] && source /lib/tiny-cloud/"$CLOUD"/mdev
|
||||
|
||||
27
lib/tiny-cloud/oci/tiny-cloud
Normal file
27
lib/tiny-cloud/oci/tiny-cloud
Normal file
@ -0,0 +1,27 @@
|
||||
# Tiny Cloud configuration
|
||||
|
||||
# REQUIRED: The instance's cloud provider (valid: aws, azure, gcp, oci)
|
||||
# valid: aws, azure, gcp, oci
|
||||
CLOUD=oci
|
||||
|
||||
# User account where instance SSH keys are installed
|
||||
#CLOUD_USER=alpine
|
||||
|
||||
# Filename of userdata file (in TINY_CLOUD_VAR directory)
|
||||
#CLOUD_USERDATA=user-data
|
||||
|
||||
# IMDS token validity, in seconds (AWS only)
|
||||
#IMDS_TOKEN_TTL=5
|
||||
|
||||
# Location of var directory
|
||||
#TINY_CLOUD_VAR=/var/lib/cloud
|
||||
|
||||
# Location of log directory
|
||||
#TINY_CLOUD_LOGS=/var/log
|
||||
|
||||
# Hotplug Method (valid: mdev)
|
||||
#HOTPLUG_TYPE=mdev
|
||||
|
||||
# Cloud-related Hotplug Modules
|
||||
# valid: vnic_eth_hotplug, nvme_ebs_links (aws)
|
||||
#HOTPLUG_MODULES=
|
||||
Loading…
x
Reference in New Issue
Block a user