Skip to content

Commit

Permalink
testing if service user switch functions on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
seanorama committed Apr 1, 2016
1 parent 433e1e0 commit ce10abb
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions ambari-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ ambari_server="${ambari_server:-localhost}"
ambari_version="${ambari_version:-2.2.1.0}"
ambari_version_major="${ambari_version_major:-$(echo ${ambari_version} | cut -c 1).x}"
ambari_server_custom_script="${ambari_server_custom_script:-/bin/true}"
ambari_user="${ambari_user:-root}"
ambari_setup_switches="${ambari_setup_switches:-}"
##ambari_repo= ## if using a local repo. Otherwise the repo path is determined automatically in a line below.
curl="curl -ksSL"

Expand Down Expand Up @@ -157,6 +159,7 @@ case "${lsb_dist}" in
mkdir -p /usr/java
ln -sf /etc/alternatives/java_sdk /usr/java/default
JAVA_HOME='/usr/java/default'
ambari_setup_switches="${ambari_setup_switches} -j ${JAVA_HOME}"
fi

printf "## fetch ambari repo\n"
Expand All @@ -174,10 +177,17 @@ case "${lsb_dist}" in
if [ "${install_ambari_server}" = true ]; then
printf "## install ambari-server\n"
yum install -q -y ambari-server
if [ "${java_provider}" = 'oracle' ]; then
ambari-server setup -s
else
ambari-server setup -j "${JAVA_HOME}" -s

if [ "${ambari_user}" != root]; then
useradd -r ${ambari_user}
ambari_setup_switches="${ambari_setup_switches} --service-user-name ${ambari_user}"
fi

echo ${ambari_setup_switches}
ambari-server setup -s "${ambari_setup_switches}"

if [ "${ambari_protocol}" = "https" ]; then
my_ambari_https
fi

sh -c "${ambari_server_custom_script}"
Expand Down

1 comment on commit ce10abb

@seanorama
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relates to #13

Please sign in to comment.