HAS_TTY='y'
HAS_COLORS="n"
-VERSION="0.9"
+VERSION="1.0"
BASENAME="$(basename ${0})"
BASE_DIR="$(dirname ${0})"
-p|--project CUSTOMER_PROJECT
The customer related name of the project - the next level
in the Hiera structure beyond the customer name.
- If not given, the Hiera customer name will be used.
+ If not given, it will not be set.
-O|--owner OWNER
The owning Customer if this host. If not given,
the Hiera customer will be used.
ENVIRONMENT=$( autodetect_env )
fi
- if [[ -z "${PROJECT}" ]] ; then
- PROJECT="${CUSTOMER}"
- fi
-
if [[ -z "${OWNER}" ]] ; then
OWNER="${CUSTOMER}"
fi
local yfile="${facts_dir}/customer.yaml"
info "Generating '${GREEN}${yfile}${NORMAL}' ..."
- local content=$( cat <<-EOF
- ---
- customer: ${CUSTOMER}
- project: ${PROJECT}
- EOF
- )
+ if [[ -z "${PROJECT}" ]] ; then
+ local content=$( cat <<-EOF
+ ---
+ customer: ${CUSTOMER}
+ EOF
+ )
+ else
+ local content=$( cat <<-EOF
+ ---
+ customer: ${CUSTOMER}
+ project: ${PROJECT}
+ EOF
+ )
+ fi
debug "Generatet content of '${yfile}':\n${content}"
echo "${content}" > "${yfile}"