Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
ca41ea2d
Commit
ca41ea2d
authored
Jun 18, 2022
by
William Sellitti
Browse files
added _getdeployconf to set all of the environment variables
parent
daffc4e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/proxmoxve.sh
View file @
ca41ea2d
...
@@ -31,50 +31,72 @@ proxmoxve_deploy(){
...
@@ -31,50 +31,72 @@ proxmoxve_deploy(){
_debug _cfullchain
"
$_cfullchain
"
_debug _cfullchain
"
$_cfullchain
"
# "Sane" defaults.
# "Sane" defaults.
_
target_hostname
=
"
$_cdomain
"
_
getdeployconf DEPLOY_PROXMOXVE_SERVER
if
[
-
n
"
$DEPLOY_PROXMOXVE_SERVER
"
]
;
then
if
[
-
z
"
$DEPLOY_PROXMOXVE_SERVER
"
]
;
then
_target_hostname
=
"
$DEPLOY_PROXMOXVE_SERVER
"
_target_hostname
=
"
$DEPLOY_PROXMOXVE_SERVER
"
else
_target_hostname
=
"
$_cdomain
"
fi
fi
_debug2 DEPLOY_PROXMOXVE_SERVER
"
$_target_hostname
"
_target_port
=
"8006"
_getdeployconf DEPLOY_PROXMOXVE_SERVER_PORT
if
[
-n
"
$DEPLOY_PROXMOXVE_SERVER_PORT
"
]
;
then
if
[
-z
"
$DEPLOY_PROXMOXVE_SERVER_PORT
"
]
;
then
_target_port
=
"8006"
else
_target_port
=
"
$DEPLOY_PROXMOXVE_SERVER_PORT
"
_target_port
=
"
$DEPLOY_PROXMOXVE_SERVER_PORT
"
fi
fi
_debug2 DEPLOY_PROXMOXVE_SERVER_PORT
"
$_target_port
"
if
[
-n
"
$DEPLOY_PROXMOXVE_NODE_NAME
"
]
;
then
_getdeployconf DEPLOY_PROXMOXVE_NODE_NAME
_node_name
=
"
$DEPLOY_PROXMOXVE_NODE_NAME
"
if
[
-z
"
$DEPLOY_PROXMOXVE_NODE_NAME
"
]
;
then
else
_node_name
=
$(
echo
"
$_target_hostname
"
|cut
-d
.
-f1
)
_node_name
=
$(
echo
"
$_target_hostname
"
|cut
-d
.
-f1
)
else
_node_name
=
"
$DEPLOY_PROXMOXVE_NODE_NAME
"
fi
fi
_debug2 DEPLOY_PROXMOXVE_NODE_NAME
"
$_node_name
"
# Complete URL.
# Complete URL.
_target_url
=
"https://
${
_target_hostname
}
:
${
_target_port
}
/api2/json/nodes/
${
_node_name
}
/certificates/custom"
_target_url
=
"https://
${
_target_hostname
}
:
${
_target_port
}
/api2/json/nodes/
${
_node_name
}
/certificates/custom"
_debug TARGET_URL
"
$_target_url
"
# More "sane" defaults.
# More "sane" defaults.
_proxmoxve_user
=
"root"
_getdeployconf DEPLOY_PROXMOXVE_USER
if
[
-n
"
$_proxmoxve_user
"
]
;
then
if
[
-z
"
$DEPLOY_PROXMOXVE_USER
"
]
;
then
_proxmoxve_user
=
"root"
else
_proxmoxve_user
=
"
$DEPLOY_PROXMOXVE_USER
"
_proxmoxve_user
=
"
$DEPLOY_PROXMOXVE_USER
"
fi
fi
_debug2 DEPLOY_PROXMOXVE_NODE_NAME
"
$_proxmoxve_user
"
_proxmoxve_user_realm
=
"pam"
_getdeployconf DEPLOY_PROXMOXVE_USER_REALM
if
[
-n
"
$DEPLOY_PROXMOXVE_USER_REALM
"
]
;
then
if
[
-z
"
$DEPLOY_PROXMOXVE_USER_REALM
"
]
;
then
_proxmoxve_user_realm
=
"pam"
else
_proxmoxve_user_realm
=
"
$DEPLOY_PROXMOXVE_USER_REALM
"
_proxmoxve_user_realm
=
"
$DEPLOY_PROXMOXVE_USER_REALM
"
fi
fi
_debug2 DEPLOY_PROXMOXVE_USER_REALM
"
$_proxmoxve_user_realm
"
_proxmoxve_api_token_name
=
"acme"
_getdeployconf DEPLOY_PROXMOXVE_API_TOKEN_NAME
if
[
-n
"
$DEPLOY_PROXMOXVE_API_TOKEN_NAME
"
]
;
then
if
[
-z
"
$DEPLOY_PROXMOXVE_API_TOKEN_NAME
"
]
;
then
_proxmoxve_api_token_name
=
"acme"
else
_proxmoxve_api_token_name
=
"
$DEPLOY_PROXMOXVE_API_TOKEN_NAME
"
_proxmoxve_api_token_name
=
"
$DEPLOY_PROXMOXVE_API_TOKEN_NAME
"
fi
fi
_debug2 DEPLOY_PROXMOXVE_API_TOKEN_NAME
"
$_proxmoxve_api_token_name
"
# This is required.
# This is required.
_
proxmoxve_api_token_key
=
"
$
DEPLOY_PROXMOXVE_API_TOKEN_KEY
"
_
getdeployconf
DEPLOY_PROXMOXVE_API_TOKEN_KEY
if
[
-z
"
$_proxmoxve_api_token_key
"
]
;
then
if
[
-z
"
$_proxmoxve_api_token_key
"
]
;
then
_err
"API key not provided."
_err
"API key not provided."
return
1
return
1
else
_proxmoxve_api_token_key
=
"
$DEPLOY_PROXMOXVE_API_TOKEN_KEY
"
fi
fi
_debug2 DEPLOY_PROXMOXVE_API_TOKEN_KEY _proxmoxve_api_token_key
# PVE API Token header value. Used in "Authorization: PVEAPIToken".
# PVE API Token header value. Used in "Authorization: PVEAPIToken".
_proxmoxve_header_api_token
=
"
${
_proxmoxve_user
}
@
${
_proxmoxve_user_realm
}
!
${
_proxmoxve_api_token_name
}
=
${
_proxmoxve_api_token_key
}
"
_proxmoxve_header_api_token
=
"
${
_proxmoxve_user
}
@
${
_proxmoxve_user_realm
}
!
${
_proxmoxve_api_token_name
}
=
${
_proxmoxve_api_token_key
}
"
_debug2
"Auth Header"
_proxmoxve_header_api_token
# Generate the data file curl will pass as the data.
# Generate the data file curl will pass as the data.
_proxmoxve_temp_data
=
"/tmp/proxmoxve_api/
$_cdomain
"
_proxmoxve_temp_data
=
"/tmp/proxmoxve_api/
$_cdomain
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment