diff options
author | Zebek Bogumil <bogumil.zebek@nokia.com> | 2021-03-29 07:38:36 +0200 |
---|---|---|
committer | Zebek Bogumil <bogumil.zebek@nokia.com> | 2021-03-29 09:36:27 +0200 |
commit | 18c0838e23209d58881dc59a4ae24a2111883ac2 (patch) | |
tree | 51d7ef3953667f2e00c733d53d91394b7818a1ce /scripts | |
parent | 0c3c63ccbe28a18f57b8341a73eca08a6ad832fc (diff) |
Add Kafka envs
Signed-off-by: Bogumil Zebek <bogumil.zebek@nokia.com>
Issue-ID: INT-1869
Change-Id: Id8f4d3061fc16e8cb2c16bf32058ec8527e4c6c3
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/run-netconf-server-application.sh | 15 | ||||
-rwxr-xr-x | scripts/set-up-netopeer.sh | 19 |
2 files changed, 22 insertions, 12 deletions
diff --git a/scripts/run-netconf-server-application.sh b/scripts/run-netconf-server-application.sh index b07da8a..81ce10f 100755 --- a/scripts/run-netconf-server-application.sh +++ b/scripts/run-netconf-server-application.sh @@ -19,19 +19,20 @@ # ============LICENSE_END========================================================= ### -if [ "$#" -eq 2 ]; then +if [ "$#" -eq 5 ]; then ## Set up variable MODELS_CONFIG_PATH=$1 MODELS_CONFIG_NAME=$2 + KAFKA_HOST_NAME=$3 + KAFKA_HOST_PORT=$4 + KAFKA_TOPIC=$5 - echo "Starting NETCONF Change listener" - python3 ./application/netconf_change_listener_application.py $MODELS_CONFIG_PATH/$MODELS_CONFIG_NAME & - - - echo "Starting NETCONF Rest server" - python3 ./application/netconf_rest_application.py $MODELS_CONFIG_PATH/$MODELS_CONFIG_NAME & + echo "[INFO] Starting NETCONF Change listener" + python3 ./application/netconf_change_listener_application.py $MODELS_CONFIG_PATH/$MODELS_CONFIG_NAME $KAFKA_HOST_NAME $KAFKA_HOST_PORT $KAFKA_TOPIC & + echo "[INFO] Starting NETCONF Rest server" + python3 ./application/netconf_rest_application.py $MODELS_CONFIG_PATH/$MODELS_CONFIG_NAME $KAFKA_HOST_NAME $KAFKA_HOST_PORT $KAFKA_TOPIC & else echo "[ERROR] Invalid number of arguments. Please provide all required arguments." diff --git a/scripts/set-up-netopeer.sh b/scripts/set-up-netopeer.sh index e7b4f76..ab285d8 100755 --- a/scripts/set-up-netopeer.sh +++ b/scripts/set-up-netopeer.sh @@ -19,11 +19,17 @@ # ============LICENSE_END========================================================= ### -if [ "$#" -ge 1 ]; then +echo "[INFO] Starting NETCONF Server app configuration ..." + +if [ "$#" -gt 1 ]; then ## Set up variable SCRIPTS_DIR=$PWD/"$(dirname $0)" enable_tls=${ENABLE_TLS:-false} + kafka_host_name=${KAFKA_HOST_NAME:-"localhost"} + kafka_port=${KAFKA_PORT:-9092} + kafka_topic=${KAFKA_TOPIC=-"config:1:1"} + models_config_path=$1 models_configuration_file_name=${MODELS_CONFIGURATION_FILE_NAME:-models-configuration.ini} ## Install all modules from given directory @@ -32,19 +38,22 @@ if [ "$#" -ge 1 ]; then ## If TLS is enabled start initializing certificates if [[ "$enable_tls" == "true" ]]; then if [ "$#" -ge 2 ]; then - echo "initializing TLS" + echo "[INFO] Initializing TLS" $SCRIPTS_DIR/install-tls-with-custom-certificates.sh $SCRIPTS_DIR/tls $2 else - echo "Missing second argument: path to file with certificates for TLS." + echo "[ERROR] Missing second argument: path to file with certificates for TLS." fi fi + echo "[INFO] NETCONF Server configuration finished." + ## Run netconf server application - $SCRIPTS_DIR/run-netconf-server-application.sh $1 $models_configuration_file_name + $SCRIPTS_DIR/run-netconf-server-application.sh $models_config_path $models_configuration_file_name $kafka_host_name $kafka_port $kafka_topic ## Run sysrepo supervisor + echo "[INFO] Starting Netopeer Server ..." /usr/bin/supervisord -c /etc/supervisord.conf else - echo "Missing first argument: path to file with YANG models." + echo "[ERROR] Unable to configure application. Provide all required arguments." fi |