defaults:
vsphere: live
cluster: vmcc-l105-01
- vm_folder: Pixelpark/Tools
+ vm_folder: Pixelpark/Tools/live
num_cpus: 2
memory: 4GB
boot_delay: 5
dns_options: 'timeout:1 attempts:2 use-vc'
vms:
- - name: repo03.pixelpark.com
+ - name: prd-repo03.pixelpark.com
interfaces:
- address_v4: 217.66.55.69
RHSM_USER='dpx-subscriber'
RHSM_PWD=
+RHSM_PWD_FILE="${BIN_DIR}/rhsm-user-passwd"
SM_BIN='subscription-manager'
detect_color
#------------------------------------------------------------------------------
usage() {
cat <<-EOF
- Usage: ${BASE_NAME} [-U USER ] [-P PASSWORD ] ${STD_USAGE}
+ Usage: ${BASE_NAME} [-U USER ] [-P PASSWORD ] [-y PASSWORD_FILE] ${STD_USAGE}
${BASE_NAME} [-h|--help]
${BASE_NAME} [-V|--version]
-U|--user USER Gives the username for the account which is registering the system.
-P|--password PASSWORD
Gives the user account password.
+ -y|--password-file PASSWORD_FILE
+ A file containing the user account password.
EOF
echo "${STD_USAGE_MSG}"
get_options() {
local tmp=
- local short_options="U:P:${STD_SHORT_OPTIONS}"
- local long_options="user:,password:,${STD_LONG_OPTIONS}"
+ local short_options="U:P:y:${STD_SHORT_OPTIONS}"
+ local long_options="user:,password:,password-file:,${STD_LONG_OPTIONS}"
set +e
tmp=$( getopt -o "${short_options}" --long "${long_options}" -n "${BASE_NAME}" -- "$@" )
RHSM_PWD="${REMAINING_OPTS[$j]}"
i=$(( $i + 2 ))
;;
+ -y|--password-file)
+ j=$(( $i + 1 ))
+ RHSM_PWD_FILE="${REMAINING_OPTS[$j]}"
+ i=$(( $i + 2 ))
+ ;;
*) echo -e "Internal error - option '${RED}${arg}${NORMAL} was wrong!"
exit 1
;;
exit 1
fi
+ if [[ -n "${RHSM_PWD_FILE}" && -f "${RHSM_PWD_FILE}" ]] ; then
+ RHSM_PWD=$( cat "${RHSM_PWD_FILE}" | head -n 1 )
+ fi
+
if [[ -z "${RHSM_PWD}" ]] ; then
error "No password of the user for registring at RedHat subscription management given."
exit 1