mirror of
https://github.com/tteck/Proxmox.git
synced 2025-02-15 06:09:15 +01:00
turnkey code refactoring
This commit is contained in:
parent
8feaf1ef84
commit
604c20df17
7 changed files with 49 additions and 126 deletions
|
@ -7,11 +7,14 @@
|
|||
# bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/turnkey/turnkey-gitlab.sh)"
|
||||
|
||||
# Setup script environment
|
||||
NAME="gitlab"
|
||||
PASS="$(openssl rand -base64 8)"
|
||||
TEMPLATE_SEARCH="debian-11-turnkey-gitlab_17.1-1_amd64.tar.gz"
|
||||
CTID=$(pvesh get /cluster/nextid)
|
||||
TEMPLATE_SEARCH="debian-11-turnkey-${NAME}_17.1-1_amd64.tar.gz"
|
||||
PCT_DISK_SIZE="8"
|
||||
PCT_OPTIONS="
|
||||
-features keyctl=1,nesting=1
|
||||
-hostname turnkey-gitlab
|
||||
-hostname turnkey-${NAME}
|
||||
-tags proxmox-helper-scripts
|
||||
-onboot 1
|
||||
-cores 4
|
||||
|
@ -118,20 +121,6 @@ function select_storage() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Test if required variables are set
|
||||
CTID=$(pvesh get /cluster/nextid)
|
||||
[[ "${CTID:-}" ]] || die "You need to set 'CTID' variable."
|
||||
|
||||
# Test if ID is valid
|
||||
[ "$CTID" -ge "100" ] || die "ID cannot be less than 100."
|
||||
|
||||
# Test if ID is in use
|
||||
if pct status $CTID &>/dev/null; then
|
||||
warn "ID '$CTID' is already in use."
|
||||
unset CTID
|
||||
die "Cannot use ID that is already in use."
|
||||
fi
|
||||
|
||||
# Get template storage
|
||||
TEMPLATE_STORAGE=$(select_storage template) || exit
|
||||
info "Using '$TEMPLATE_STORAGE' for template storage."
|
||||
|
@ -168,8 +157,8 @@ pct create $CTID ${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE} ${PCT_OPTIONS[@]} >/dev/
|
|||
msg "Starting LXC Container..."
|
||||
pct start "$CTID"
|
||||
info "LXC container '$CTID' was successfully created."
|
||||
echo "TurnKey GitLab Password" >>~/turnkey-gitlab.creds # file is located in the Proxmox root directory
|
||||
echo $PASS >>~/turnkey-gitlab.creds #run `cat turnkey-gitlab.creds` in the Proxmox shell
|
||||
echo "TurnKey ${NAME} Password" >>~/turnkey-${NAME}.creds # file is located in the Proxmox root directory
|
||||
echo $PASS >>~/turnkey-${NAME}.creds
|
||||
if [[ -f /etc/systemd/system/ping-instances.service ]]; then
|
||||
systemctl start ping-instances.service
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue