mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-13 06:32:14 +01:00
contrib: allow user to provide cloud-config template
Respecting that substitutions will still be made, the user may want to also install their own unit files or similar Signed-off-by: Vincent Batts <vbatts@kinvolk.io>
This commit is contained in:
parent
bc11ee282d
commit
a43fcbb534
@ -15,6 +15,7 @@ Options:
|
|||||||
-l http://IP:PORT Listen URL for client communication.
|
-l http://IP:PORT Listen URL for client communication.
|
||||||
-u http://IP:PORT Listen URL for server communication.
|
-u http://IP:PORT Listen URL for server communication.
|
||||||
-n NAME etcd node name.
|
-n NAME etcd node name.
|
||||||
|
-c FILE cloud-config template to use, instead of the default.
|
||||||
-p DEST Create config-drive ISO image to the given path.
|
-p DEST Create config-drive ISO image to the given path.
|
||||||
-S FILE SSH keys file.
|
-S FILE SSH keys file.
|
||||||
-t TOKEN Token ID from https://discovery.etcd.io.
|
-t TOKEN Token ID from https://discovery.etcd.io.
|
||||||
@ -44,11 +45,12 @@ hostname: <HOSTNAME>
|
|||||||
"
|
"
|
||||||
REGEX_SSH_FILE="^ssh-(rsa|dss|ed25519) [-A-Za-z0-9+\/]+[=]{0,2} .+"
|
REGEX_SSH_FILE="^ssh-(rsa|dss|ed25519) [-A-Za-z0-9+\/]+[=]{0,2} .+"
|
||||||
|
|
||||||
while getopts "d:e:H:i:n:p:S:t:l:u:h" OPTION
|
while getopts "d:e:c:H:i:n:p:S:t:l:u:h" OPTION
|
||||||
do
|
do
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
d) ETCD_DISCOVERY="$OPTARG" ;;
|
d) ETCD_DISCOVERY="$OPTARG" ;;
|
||||||
e) ETCD_ADDR="$OPTARG" ;;
|
e) ETCD_ADDR="$OPTARG" ;;
|
||||||
|
c) CLOUD_CONFIG_FILE="${OPTARG}" ;;
|
||||||
H) HNAME="$OPTARG" ;;
|
H) HNAME="$OPTARG" ;;
|
||||||
i) ETCD_PEER_URLS="$OPTARG" ;;
|
i) ETCD_PEER_URLS="$OPTARG" ;;
|
||||||
n) ETCD_NAME="$OPTARG" ;;
|
n) ETCD_NAME="$OPTARG" ;;
|
||||||
@ -145,6 +147,10 @@ if [ -z "$ETCD_LISTEN_CLIENT_URLS" ]; then
|
|||||||
ETCD_LISTEN_CLIENT_URLS=$DEFAULT_ETCD_LISTEN_CLIENT_URLS
|
ETCD_LISTEN_CLIENT_URLS=$DEFAULT_ETCD_LISTEN_CLIENT_URLS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${CLOUD_CONFIG_FILE}" ]; then
|
||||||
|
CLOUD_CONFIG="$(cat ${CLOUD_CONFIG_FILE})"
|
||||||
|
fi
|
||||||
|
|
||||||
WORKDIR="${DEST}/tmp.${RANDOM}"
|
WORKDIR="${DEST}/tmp.${RANDOM}"
|
||||||
mkdir "$WORKDIR"
|
mkdir "$WORKDIR"
|
||||||
trap "rm -rf '${WORKDIR}'" EXIT
|
trap "rm -rf '${WORKDIR}'" EXIT
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user