From: Frank Brehm Date: Mon, 12 Oct 2020 11:53:21 +0000 (+0200) Subject: Setting project for Sparkasse customers, if not given X-Git-Tag: 1.4.9~1^2 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=a5a1dd73edecbf0ba9f01df2c1890d2a956316a2;p=pixelpark%2Fcreate-terraform.git Setting project for Sparkasse customers, if not given --- diff --git a/postinstall-scripts/init-puppet b/postinstall-scripts/init-puppet index 63de5c8..72b1f9c 100755 --- a/postinstall-scripts/init-puppet +++ b/postinstall-scripts/init-puppet @@ -21,7 +21,7 @@ NORMAL="" HAS_TTY='y' HAS_COLORS="n" -VERSION="1.1" +VERSION="1.2" BASENAME="$(basename ${0})" BASE_DIR="$(dirname ${0})" @@ -358,6 +358,13 @@ get_options() { TIER="${ENVIRONMENT}" fi + if [[ -z "${PROJECT}" ]] ; then + if [[ "${CUSTOMER}" =~ ^spk- ]] ; then + warn "No project for customer '${YELLOW}${CUSTOMER}${NORMAL}' given, setting it to customer." + PROJECT="${CUSTOMER}" + fi + fi + if [[ -z "${ROLE}" ]] ; then echo "Option '${RED}-R|--role${NORMAL}' may not be empty." >&2 echo >&2 @@ -367,12 +374,17 @@ get_options() { debug "Using following options:" if [[ "${VERBOSE}" == "y" ]] ; then + local project_out="${CYAN}${NORMAL}" + if [[ -n "${PROJECT}" ]] ; then + project_out="${GREEN}${PROJECT}${NORMAL}" + fi local msg=$( cat <<-EOF FQDN: ${GREEN}${FQDN}${NORMAL} Puppet environment: ${GREEN}${ENVIRONMENT}${NORMAL} Tier: ${GREEN}${TIER}${NORMAL} Role: ${GREEN}${ROLE}${NORMAL} Hiera customer: ${GREEN}${CUSTOMER}${NORMAL} + Customer project: ${project_out} Owner: ${GREEN}${OWNER}${NORMAL} Contact address: ${GREEN}${CONTACT}${NORMAL} Purpose: ${GREEN}${PURPOSE}${NORMAL}