Skip to content

Commit

Permalink
krb fix is not fatal
Browse files Browse the repository at this point in the history
print err and success msgs on both stdout and stderr
remove old jira paths
update sso_bypass login url
  • Loading branch information
andylytical committed Oct 3, 2024
1 parent 60f1368 commit 1cfd207
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
7 changes: 5 additions & 2 deletions bin/fix_keytab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ KEYTAB_NEW="${KEYTAB}.${HOSTNAME_NEW}"
$action mv "$KEYTAB" "${KEYTAB}.${HOSTNAME_OLD}"

# put new keytab in place
[[ -f "${KEYTAB_NEW}" ]] || die "cant find keytab file '${KEYTAB_NEW}'"
$action ln -s "${KEYTAB_NEW}" "${KEYTAB}"
if [[ -f "${KEYTAB_NEW}" ]] ; then
$action ln -s "${KEYTAB_NEW}" "${KEYTAB}"
else
err "cant find keytab file '${KEYTAB_NEW}'"
fi
23 changes: 15 additions & 8 deletions bin/go_validate_test_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,24 @@ hostnamectl status --static | grep -q "$HOSTNAME_NEW" \
|| die "Hostname does NOT match '$HOSTNAME_NEW'"
success "Hostname looks good!"

# fix_keytab.sh
# check keytab
klist -k /etc/krb5.keytab | grep -q -F "${HOSTNAME_OLD}" \
&& die "Old hostname still in keytab"
klist -k /etc/krb5.keytab | grep -q -F "${HOSTNAME_NEW}" \
|| die "New hostname NOT in keytab"
success "KRB5 keytab looks good!"

# fix_app_config.sh
# check server.xml
XML="$APP_INSTALL_DIR"/conf/server.xml
grep -F 'proxyName=' "$XML" | grep -q "$HOSTNAME_NEW" \
|| die "New hostname not found in '$XML'"
success "server.xml has new hostname"

# fix_keytab.sh
# check keytab
# Not fatal on failure
krb_ok=$YES
klist -k /etc/krb5.keytab | grep -q -F "${HOSTNAME_OLD}" && {
err "Old hostname still in keytab"
krb_ok=$NO
}
klist -k /etc/krb5.keytab | grep -q -F "${HOSTNAME_NEW}" || {
err "New hostname NOT in keytab"
krb_ok=$NO
}
[[ $krb_ok -eq $YES ]] \
&& success "KRB5 keytab looks good!"
2 changes: 1 addition & 1 deletion bin/sso_bypass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ verify_auth_fallback_status() {

if [[ "$MODE" == "true" && "$_verify" == "0" ]]; then
echo "SSO Bypass successfully enabled"
echo "Access site at http://$MACHINE/login.action?auth_fallback to login."
echo "To login with username/password, go to: https://$MACHINE/login.jsp?auth_fallback"
exit 0
elif [[ "$MODE" == "false" && "$_verify" == "1" ]]; then
echo "SSO Bypass successfully disabled"
Expand Down
6 changes: 1 addition & 5 deletions conf/config.sh-jira-sample
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ HOSTNAME_NEW=$HOSTNAME_OLD

# path to jira / confluence home & install dirs
APP_NAME=jira
#APP_HOME_DIR=/usr/services/jirahome #TODO - remove old dirs after 6 Sep
#APP_INSTALL_DIR=/usr/services/jira-standalone #TODO - remove old dirs after 6 Sep
APP_HOME_DIR=/srv/${APP_NAME}/home
APP_INSTALL_DIR=/srv/${APP_NAME}/app


# arrays of service names
# TODO - remove CRASHPLAN when no longer appropriate
SYSTEM_SERVICES_TO_STOP=( puppet telegraf crashplan $APP_NAME )
#SYSTEM_SERVICES_TO_STOP=( puppet telegraf xcatpostinit1 $APP_NAME )
SYSTEM_SERVICES_TO_STOP=( puppet telegraf xcatpostinit1 $APP_NAME )
PUPPET_SERVICES_TO_STOP=( telegraf )

#
Expand Down
4 changes: 2 additions & 2 deletions lib/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ BASE=${HOME}/atlassian-tools


err() {
echo -e "${RED}✗ ERROR: $*${NC}" 1>&2
echo -e "${RED}✗ ERROR: $*${NC}" | tee /dev/stderr
}

success() {
echo -e "${GREEN}$*${NC}"
echo -e "${GREEN}$*${NC}" | tee /dev/stderr
}


Expand Down

0 comments on commit 1cfd207

Please sign in to comment.