From a6519611a11a10ef28f111850bd2b31aa08fbe98 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Mon, 2 Dec 2019 10:07:58 -0800 Subject: [PATCH] format codes --- cookbooks/gocd/recipes/install-agent.bash | 15 +++++------ cookbooks/gocd/recipes/install-server.bash | 13 +++++----- cookbooks/groovy/recipes/install.bash | 7 ++--- cookbooks/jenkins/libraries/app.bash | 6 +++-- cookbooks/jenkins/recipes/install-master.bash | 17 ++++++------ cookbooks/kibana/recipes/install.bash | 25 +++++++++--------- cookbooks/mongodb/recipes/install.bash | 21 ++++++++------- cookbooks/mysql/recipes/install.bash | 14 +++++----- cookbooks/nginx/attributes/default.bash | 4 +-- cookbooks/nginx/recipes/install.bash | 19 +++++++------- cookbooks/node/recipes/install.bash | 7 ++--- cookbooks/pm2/recipes/install.bash | 14 +++++----- cookbooks/python/recipes/install.bash | 7 ++--- cookbooks/selenium-server/libraries/app.bash | 18 +++++++------ .../selenium-server/recipes/install-hub.bash | 6 ++--- .../selenium-server/recipes/install-node.bash | 10 +++---- .../splunkforwarder/recipes/install.bash | 11 ++++---- cookbooks/tomcat/recipes/install.bash | 26 +++++++++---------- cookbooks/wildfly/recipes/install.bash | 15 +++++------ 19 files changed, 129 insertions(+), 126 deletions(-) diff --git a/cookbooks/gocd/recipes/install-agent.bash b/cookbooks/gocd/recipes/install-agent.bash index 23aca98e..8a5061bb 100755 --- a/cookbooks/gocd/recipes/install-agent.bash +++ b/cookbooks/gocd/recipes/install-agent.bash @@ -57,15 +57,14 @@ function install() serverHostname='127.0.0.1' fi - local -r initConfigData=( - '__AGENT_INSTALL_FOLDER_PATH__' "${GOCD_AGENT_INSTALL_FOLDER_PATH}" - '__SERVER_HOSTNAME__' "${serverHostname}" - '__GO_HOME_FOLDER__' "$(getUserHomeFolder "${GOCD_USER_NAME}")" - '__USER_NAME__' "${GOCD_USER_NAME}" + createInitFileFromTemplate \ + "${GOCD_AGENT_SERVICE_NAME}" \ + "$(dirname "${BASH_SOURCE[0]}")/../templates" \ + '__AGENT_INSTALL_FOLDER_PATH__' "${GOCD_AGENT_INSTALL_FOLDER_PATH}" \ + '__SERVER_HOSTNAME__' "${serverHostname}" \ + '__GO_HOME_FOLDER__' "$(getUserHomeFolder "${GOCD_USER_NAME}")" \ + '__USER_NAME__' "${GOCD_USER_NAME}" \ '__GROUP_NAME__' "${GOCD_GROUP_NAME}" - ) - - createInitFileFromTemplate "${GOCD_AGENT_SERVICE_NAME}" "$(dirname "${BASH_SOURCE[0]}")/../templates" "${initConfigData[@]}" # Start diff --git a/cookbooks/gocd/recipes/install-server.bash b/cookbooks/gocd/recipes/install-server.bash index dfd846f2..2d9ad015 100755 --- a/cookbooks/gocd/recipes/install-server.bash +++ b/cookbooks/gocd/recipes/install-server.bash @@ -50,14 +50,13 @@ function install() # Config Init - local -r initConfigData=( - '__SERVER_INSTALL_FOLDER_PATH__' "${GOCD_SERVER_INSTALL_FOLDER_PATH}" - '__GO_HOME_FOLDER__' "$(getUserHomeFolder "${GOCD_USER_NAME}")" - '__USER_NAME__' "${GOCD_USER_NAME}" + createInitFileFromTemplate \ + "${GOCD_SERVER_SERVICE_NAME}" \ + "$(dirname "${BASH_SOURCE[0]}")/../templates" \ + '__SERVER_INSTALL_FOLDER_PATH__' "${GOCD_SERVER_INSTALL_FOLDER_PATH}" \ + '__GO_HOME_FOLDER__' "$(getUserHomeFolder "${GOCD_USER_NAME}")" \ + '__USER_NAME__' "${GOCD_USER_NAME}" \ '__GROUP_NAME__' "${GOCD_GROUP_NAME}" - ) - - createInitFileFromTemplate "${GOCD_SERVER_SERVICE_NAME}" "$(dirname "${BASH_SOURCE[0]}")/../templates" "${initConfigData[@]}" # Start diff --git a/cookbooks/groovy/recipes/install.bash b/cookbooks/groovy/recipes/install.bash index d9eae901..4fbd9953 100755 --- a/cookbooks/groovy/recipes/install.bash +++ b/cookbooks/groovy/recipes/install.bash @@ -50,9 +50,10 @@ function install() # Config Profile - local -r profileConfigData=('__INSTALL_FOLDER_PATH__' "${GROOVY_INSTALL_FOLDER_PATH}") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/groovy.sh.profile" '/etc/profile.d/groovy.sh' "${profileConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/groovy.sh.profile" \ + '/etc/profile.d/groovy.sh' \ + '__INSTALL_FOLDER_PATH__' "${GROOVY_INSTALL_FOLDER_PATH}" # Display Version diff --git a/cookbooks/jenkins/libraries/app.bash b/cookbooks/jenkins/libraries/app.bash index 551404f3..ef8fbdab 100755 --- a/cookbooks/jenkins/libraries/app.bash +++ b/cookbooks/jenkins/libraries/app.bash @@ -78,9 +78,11 @@ function jenkinsMasterUnlock() { header 'UNLOCKING JENKINS' - local -r configData=('true' 'false') + createFileFromTemplate \ + "${JENKINS_INSTALL_FOLDER_PATH}/config.xml" \ + "${JENKINS_INSTALL_FOLDER_PATH}/config.xml" \ + 'true' 'false' - createFileFromTemplate "${JENKINS_INSTALL_FOLDER_PATH}/config.xml" "${JENKINS_INSTALL_FOLDER_PATH}/config.xml" "${configData[@]}" cat "${JENKINS_INSTALL_FOLDER_PATH}/config.xml" echo '2.0' > "${JENKINS_INSTALL_FOLDER_PATH}/jenkins.install.InstallUtil.lastExecVersion" diff --git a/cookbooks/jenkins/recipes/install-master.bash b/cookbooks/jenkins/recipes/install-master.bash index 65ed4443..c72d7e25 100755 --- a/cookbooks/jenkins/recipes/install-master.bash +++ b/cookbooks/jenkins/recipes/install-master.bash @@ -47,19 +47,20 @@ function install() # Config Profile - local -r profileConfigData=('__INSTALL_FOLDER_PATH__' "${JENKINS_INSTALL_FOLDER_PATH}") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/jenkins.sh.profile" '/etc/profile.d/jenkins.sh' "${profileConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/jenkins.sh.profile" \ + '/etc/profile.d/jenkins.sh' \ + '__INSTALL_FOLDER_PATH__' "${JENKINS_INSTALL_FOLDER_PATH}" # Config Cron - local -r cronConfigData=( - '__USER_NAME__' "${JENKINS_USER_NAME}" - '__GROUP_NAME__' "${JENKINS_GROUP_NAME}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/jenkins.cron" \ + '/etc/cron.daily/jenkins' \ + '__USER_NAME__' "${JENKINS_USER_NAME}" \ + '__GROUP_NAME__' "${JENKINS_GROUP_NAME}" \ '__INSTALL_FOLDER_PATH__' "${JENKINS_INSTALL_FOLDER_PATH}" - ) - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/jenkins.cron" '/etc/cron.daily/jenkins' "${cronConfigData[@]}" chmod 755 '/etc/cron.daily/jenkins' # Install diff --git a/cookbooks/kibana/recipes/install.bash b/cookbooks/kibana/recipes/install.bash index 6b017457..56f6a115 100755 --- a/cookbooks/kibana/recipes/install.bash +++ b/cookbooks/kibana/recipes/install.bash @@ -14,27 +14,26 @@ function install() # Config Server - local -r serverConfigData=( + createFileFromTemplate \ + "${KIBANA_INSTALL_FOLDER_PATH}/config/kibana.yml" \ + "${KIBANA_INSTALL_FOLDER_PATH}/config/kibana.yml" \ 'http://localhost:9200' "${KIBANA_ELASTIC_SEARCH_URL}" - ) - - createFileFromTemplate "${KIBANA_INSTALL_FOLDER_PATH}/config/kibana.yml" "${KIBANA_INSTALL_FOLDER_PATH}/config/kibana.yml" "${serverConfigData[@]}" # Config Profile - local -r profileConfigData=('__INSTALL_FOLDER_PATH__' "${KIBANA_INSTALL_FOLDER_PATH}") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/kibana.sh.profile" '/etc/profile.d/kibana.sh' "${profileConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/kibana.sh.profile" \ + '/etc/profile.d/kibana.sh' \ + '__INSTALL_FOLDER_PATH__' "${KIBANA_INSTALL_FOLDER_PATH}" # Config Init - local -r initConfigData=( - '__INSTALL_FOLDER_PATH__' "${KIBANA_INSTALL_FOLDER_PATH}" - '__USER_NAME__' "${KIBANA_USER_NAME}" + createInitFileFromTemplate \ + "${KIBANA_SERVICE_NAME}" \ + "$(dirname "${BASH_SOURCE[0]}")/../templates" \ + '__INSTALL_FOLDER_PATH__' "${KIBANA_INSTALL_FOLDER_PATH}" \ + '__USER_NAME__' "${KIBANA_USER_NAME}" \ '__GROUP_NAME__' "${KIBANA_GROUP_NAME}" - ) - - createInitFileFromTemplate "${KIBANA_SERVICE_NAME}" "$(dirname "${BASH_SOURCE[0]}")/../templates" "${initConfigData[@]}" # Start diff --git a/cookbooks/mongodb/recipes/install.bash b/cookbooks/mongodb/recipes/install.bash index 64e93a46..b500bf0b 100755 --- a/cookbooks/mongodb/recipes/install.bash +++ b/cookbooks/mongodb/recipes/install.bash @@ -15,21 +15,22 @@ function install() # Config Profile - local -r profileConfigData=('__INSTALL_FOLDER_PATH__' "${MONGODB_INSTALL_FOLDER_PATH}") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/mongodb.sh.profile" '/etc/profile.d/mongodb.sh' "${profileConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/mongodb.sh.profile" \ + '/etc/profile.d/mongodb.sh' \ + '__INSTALL_FOLDER_PATH__' "${MONGODB_INSTALL_FOLDER_PATH}" # Config Init - local -r initConfigData=( - '__INSTALL_FOLDER_PATH__' "${MONGODB_INSTALL_FOLDER_PATH}" - '__INSTALL_DATA_FOLDER__' "${MONGODB_INSTALL_DATA_FOLDER}" - '__USER_NAME__' "${MONGODB_USER_NAME}" - '__GROUP_NAME__' "${MONGODB_GROUP_NAME}" + createInitFileFromTemplate \ + "${MONGODB_SERVICE_NAME}" \ + "$(dirname "${BASH_SOURCE[0]}")/../templates" \ + '__INSTALL_FOLDER_PATH__' "${MONGODB_INSTALL_FOLDER_PATH}" \ + '__INSTALL_DATA_FOLDER__' "${MONGODB_INSTALL_DATA_FOLDER}" \ + '__USER_NAME__' "${MONGODB_USER_NAME}" \ + '__GROUP_NAME__' "${MONGODB_GROUP_NAME}" \ '__PORT__' "${MONGODB_PORT}" - ) - createInitFileFromTemplate "${MONGODB_SERVICE_NAME}" "$(dirname "${BASH_SOURCE[0]}")/../templates" "${initConfigData[@]}" chown -R "$(whoami):$(whoami)" "${MONGODB_INSTALL_FOLDER_PATH}" # Start diff --git a/cookbooks/mysql/recipes/install.bash b/cookbooks/mysql/recipes/install.bash index 56555391..18c28e4b 100755 --- a/cookbooks/mysql/recipes/install.bash +++ b/cookbooks/mysql/recipes/install.bash @@ -34,9 +34,10 @@ function install() # Config Server - local -r serverConfigData=('__PORT__' "${MYSQL_PORT}") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/my.cnf.conf" "${MYSQL_INSTALL_FOLDER_PATH}/my.cnf" "${serverConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/my.cnf.conf" \ + "${MYSQL_INSTALL_FOLDER_PATH}/my.cnf" \ + '__PORT__' "${MYSQL_PORT}" # Config Service @@ -45,9 +46,10 @@ function install() # Config Profile - local -r profileConfigData=('__INSTALL_FOLDER_PATH__' "${MYSQL_INSTALL_FOLDER_PATH}") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/mysql.sh.profile" '/etc/profile.d/mysql.sh' "${profileConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/mysql.sh.profile" \ + '/etc/profile.d/mysql.sh' \ + '__INSTALL_FOLDER_PATH__' "${MYSQL_INSTALL_FOLDER_PATH}" # Start diff --git a/cookbooks/nginx/attributes/default.bash b/cookbooks/nginx/attributes/default.bash index 8c639ce9..de898610 100755 --- a/cookbooks/nginx/attributes/default.bash +++ b/cookbooks/nginx/attributes/default.bash @@ -2,5 +2,5 @@ export NGINX_PORT='80' -export AMAZON_LINUX_ID='centos' -export AMAZON_LINUX_VERSION_ID='7' \ No newline at end of file +export NGINX_AMAZON_LINUX_ID='centos' +export NGINX_AMAZON_LINUX_VERSION_ID='7' \ No newline at end of file diff --git a/cookbooks/nginx/recipes/install.bash b/cookbooks/nginx/recipes/install.bash index 83fa0c49..ed3f4fde 100755 --- a/cookbooks/nginx/recipes/install.bash +++ b/cookbooks/nginx/recipes/install.bash @@ -14,9 +14,11 @@ function install() source "${releaseFilePath}" - local -r configData=('__DISTRIBUTION_CODE_NAME__' "${DISTRIB_CODENAME}") + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/nginx.list.apt" \ + '/etc/apt/sources.list.d/nginx.list' \ + '__DISTRIBUTION_CODE_NAME__' "${DISTRIB_CODENAME}" - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/nginx.list.apt" '/etc/apt/sources.list.d/nginx.list' "${configData[@]}" curl -s -L 'http://nginx.org/keys/nginx_signing.key' --retry 12 --retry-delay 5 | apt-key add - apt-get update -m else @@ -30,18 +32,17 @@ function install() if [[ "${ID}" = 'amzn' ]] then - ID="${AMAZON_LINUX_ID}" - VERSION_ID="${AMAZON_LINUX_VERSION_ID}" + ID="${NGINX_AMAZON_LINUX_ID}" + VERSION_ID="${NGINX_AMAZON_LINUX_VERSION_ID}" fi # Generate Repo File - local -r configData=( - '__PLATFORM_FAMILY__' "${ID}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/nginx.repo" \ + '/etc/yum.repos.d/nginx.repo' \ + '__PLATFORM_FAMILY__' "${ID}" \ '__PLATFORM_VERSION__' "$(awk -F '.' '{ print $1 }' <<< "${VERSION_ID}")" - ) - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/nginx.repo" '/etc/yum.repos.d/nginx.repo' "${configData[@]}" fi # Install diff --git a/cookbooks/node/recipes/install.bash b/cookbooks/node/recipes/install.bash index 7e5c088a..1aa1025e 100755 --- a/cookbooks/node/recipes/install.bash +++ b/cookbooks/node/recipes/install.bash @@ -63,9 +63,10 @@ function install() # Config Profile - local -r profileConfigData=('__INSTALL_FOLDER_PATH__' "${NODE_INSTALL_FOLDER_PATH}") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/node.sh.profile" '/etc/profile.d/node.sh' "${profileConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/node.sh.profile" \ + '/etc/profile.d/node.sh' \ + '__INSTALL_FOLDER_PATH__' "${NODE_INSTALL_FOLDER_PATH}" # Clean Up diff --git a/cookbooks/pm2/recipes/install.bash b/cookbooks/pm2/recipes/install.bash index e9aa1a33..3c37f20c 100755 --- a/cookbooks/pm2/recipes/install.bash +++ b/cookbooks/pm2/recipes/install.bash @@ -36,15 +36,17 @@ function install() # Config Profile - local -r profileConfigData=('__HOME_FOLDER__' "${userHome}/.pm2") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/pm2.sh.profile" '/etc/profile.d/pm2.sh' "${profileConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/pm2.sh.profile" \ + '/etc/profile.d/pm2.sh' \ + '__HOME_FOLDER__' "${userHome}/.pm2" # Config Log Rotate - local -r logrotateConfigData=('__HOME_FOLDER__' "${userHome}/.pm2") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/pm2.logrotate" '/etc/logrotate.d/pm2' "${logrotateConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/pm2.logrotate" \ + '/etc/logrotate.d/pm2' \ + '__HOME_FOLDER__' "${userHome}/.pm2" # Clean Up diff --git a/cookbooks/python/recipes/install.bash b/cookbooks/python/recipes/install.bash index a0ed875a..533f3cf1 100755 --- a/cookbooks/python/recipes/install.bash +++ b/cookbooks/python/recipes/install.bash @@ -20,9 +20,10 @@ function install() # Config Profile - local -r profileConfigData=('__INSTALL_FOLDER_PATH__' "${PYTHON_INSTALL_FOLDER_PATH}") - - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/python.sh.profile" '/etc/profile.d/python.sh' "${profileConfigData[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/python.sh.profile" \ + '/etc/profile.d/python.sh' \ + '__INSTALL_FOLDER_PATH__' "${PYTHON_INSTALL_FOLDER_PATH}" # Display Version diff --git a/cookbooks/selenium-server/libraries/app.bash b/cookbooks/selenium-server/libraries/app.bash index af0a9b90..66d66447 100755 --- a/cookbooks/selenium-server/libraries/app.bash +++ b/cookbooks/selenium-server/libraries/app.bash @@ -25,18 +25,20 @@ function installRole() local -r configFile="${SELENIUM_SERVER_INSTALL_FOLDER_PATH}/selenium-server-${role}.json" - createFileFromTemplate "$(dirname "${BASH_SOURCE[0]}")/../templates/selenium-server-${role}.json.conf" "${configFile}" "${serverConfigDataRole[@]}" + createFileFromTemplate \ + "$(dirname "${BASH_SOURCE[0]}")/../templates/selenium-server-${role}.json.conf" \ + "${configFile}" \ + "${serverConfigDataRole[@]}" # Config Init - local -r initConfigData=( - '__INSTALL_FILE__' "${jarFile}" - '__CONFIG_FILE__' "${configFile}" - '__USER_NAME__' "${SELENIUM_SERVER_USER_NAME}" + createInitFileFromTemplate \ + "selenium-server-${role}" \ + "$(dirname "${BASH_SOURCE[0]}")/../templates" \ + '__INSTALL_FILE__' "${jarFile}" \ + '__CONFIG_FILE__' "${configFile}" \ + '__USER_NAME__' "${SELENIUM_SERVER_USER_NAME}" \ '__GROUP_NAME__' "${SELENIUM_SERVER_GROUP_NAME}" - ) - - createInitFileFromTemplate "selenium-server-${role}" "$(dirname "${BASH_SOURCE[0]}")/../templates" "${initConfigData[@]}" # Start diff --git a/cookbooks/selenium-server/recipes/install-hub.bash b/cookbooks/selenium-server/recipes/install-hub.bash index 497e141c..98bbc1ec 100755 --- a/cookbooks/selenium-server/recipes/install-hub.bash +++ b/cookbooks/selenium-server/recipes/install-hub.bash @@ -14,11 +14,9 @@ function install() # Install - local -r serverConfigData=( + installRole \ + 'hub' \ '__PORT__' "${SELENIUM_SERVER_PORT}" - ) - - installRole 'hub' "${serverConfigData[@]}" # Display Open Ports diff --git a/cookbooks/selenium-server/recipes/install-node.bash b/cookbooks/selenium-server/recipes/install-node.bash index 9943f7fe..fb1f4cd0 100755 --- a/cookbooks/selenium-server/recipes/install-node.bash +++ b/cookbooks/selenium-server/recipes/install-node.bash @@ -25,13 +25,11 @@ function install() # Install Role - local -r serverConfigData=( - '__PORT__' "${SELENIUM_SERVER_PORT}" - '__HUB_PORT__' "${SELENIUM_SERVER_HUB_PORT}" + installRole \ + 'node' \ + '__PORT__' "${SELENIUM_SERVER_PORT}" \ + '__HUB_PORT__' "${SELENIUM_SERVER_HUB_PORT}" \ '__HUB_HOST__' "${SELENIUM_SERVER_HUB_HOST}" - ) - - installRole 'node' "${serverConfigData[@]}" # Display Open Ports diff --git a/cookbooks/splunkforwarder/recipes/install.bash b/cookbooks/splunkforwarder/recipes/install.bash index 9d46b2db..6dbc971e 100755 --- a/cookbooks/splunkforwarder/recipes/install.bash +++ b/cookbooks/splunkforwarder/recipes/install.bash @@ -16,13 +16,12 @@ function install() if [[ "$(existCommand 'systemctl')" = 'true' ]] then - local -r initConfigData=( - '__GROUP_NAME__' "${SPLUNKFORWARDER_GROUP_NAME}" - '__INSTALL_FOLDER_PATH__' "${SPLUNKFORWARDER_INSTALL_FOLDER_PATH}" + createInitFileFromTemplate \ + "${SPLUNKFORWARDER_SERVICE_NAME}" \ + "$(dirname "${BASH_SOURCE[0]}")/../templates" \ + '__GROUP_NAME__' "${SPLUNKFORWARDER_GROUP_NAME}" \ + '__INSTALL_FOLDER_PATH__' "${SPLUNKFORWARDER_INSTALL_FOLDER_PATH}" \ '__USER_NAME__' "${SPLUNKFORWARDER_USER_NAME}" - ) - - createInitFileFromTemplate "${SPLUNKFORWARDER_SERVICE_NAME}" "$(dirname "${BASH_SOURCE[0]}")/../templates" "${initConfigData[@]}" else "${SPLUNKFORWARDER_INSTALL_FOLDER_PATH}/bin/splunk" enable boot-start --accept-license --answer-yes --no-prompt fi diff --git a/cookbooks/tomcat/recipes/install.bash b/cookbooks/tomcat/recipes/install.bash index 8548e4b8..596eda49 100755 --- a/cookbooks/tomcat/recipes/install.bash +++ b/cookbooks/tomcat/recipes/install.bash @@ -22,14 +22,13 @@ function install() # Config Server - local -r serverConfigData=( - 8009 "${TOMCAT_AJP_PORT}" - 8005 "${TOMCAT_COMMAND_PORT}" - 8080 "${TOMCAT_HTTP_PORT}" - 8443 "${TOMCAT_HTTPS_PORT}" - ) - - createFileFromTemplate "${TOMCAT_INSTALL_FOLDER_PATH}/conf/server.xml" "${TOMCAT_INSTALL_FOLDER_PATH}/conf/server.xml" "${serverConfigData[@]}" + createFileFromTemplate \ + "${TOMCAT_INSTALL_FOLDER_PATH}/conf/server.xml" \ + "${TOMCAT_INSTALL_FOLDER_PATH}/conf/server.xml" \ + '8009' "${TOMCAT_AJP_PORT}" \ + '8005' "${TOMCAT_COMMAND_PORT}" \ + '8080' "${TOMCAT_HTTP_PORT}" \ + '8443' "${TOMCAT_HTTPS_PORT}" # Add User @@ -37,13 +36,12 @@ function install() # Config Init - local -r initConfigData=( - '__INSTALL_FOLDER_PATH__' "${TOMCAT_INSTALL_FOLDER_PATH}" - '__USER_NAME__' "${TOMCAT_USER_NAME}" + createInitFileFromTemplate \ + "${TOMCAT_SERVICE_NAME}" \ + "$(dirname "${BASH_SOURCE[0]}")/../templates" \ + '__INSTALL_FOLDER_PATH__' "${TOMCAT_INSTALL_FOLDER_PATH}" \ + '__USER_NAME__' "${TOMCAT_USER_NAME}" \ '__GROUP_NAME__' "${TOMCAT_GROUP_NAME}" - ) - - createInitFileFromTemplate "${TOMCAT_SERVICE_NAME}" "$(dirname "${BASH_SOURCE[0]}")/../templates" "${initConfigData[@]}" # Start diff --git a/cookbooks/wildfly/recipes/install.bash b/cookbooks/wildfly/recipes/install.bash index e63607f8..f39c4a39 100755 --- a/cookbooks/wildfly/recipes/install.bash +++ b/cookbooks/wildfly/recipes/install.bash @@ -22,15 +22,14 @@ function install() # Config Init - local -r initConfigData=( - '__APPLICATION_BIND_ADDRESS__' "${WILDFLY_APPLICATION_BIND_ADDRESS}" - '__GROUP_NAME__' "${WILDFLY_GROUP_NAME}" - '__INSTALL_FOLDER_PATH__' "${WILDFLY_INSTALL_FOLDER_PATH}" - '__MANAGEMENT_BIND_ADDRESS__' "${WILDFLY_MANAGEMENT_BIND_ADDRESS}" + createInitFileFromTemplate \ + "${WILDFLY_SERVICE_NAME}" \ + "$(dirname "${BASH_SOURCE[0]}")/../templates" \ + '__APPLICATION_BIND_ADDRESS__' "${WILDFLY_APPLICATION_BIND_ADDRESS}" \ + '__GROUP_NAME__' "${WILDFLY_GROUP_NAME}" \ + '__INSTALL_FOLDER_PATH__' "${WILDFLY_INSTALL_FOLDER_PATH}" \ + '__MANAGEMENT_BIND_ADDRESS__' "${WILDFLY_MANAGEMENT_BIND_ADDRESS}" \ '__USER_NAME__' "${WILDFLY_USER_NAME}" - ) - - createInitFileFromTemplate "${WILDFLY_SERVICE_NAME}" "$(dirname "${BASH_SOURCE[0]}")/../templates" "${initConfigData[@]}" # Add Management User