From 50f5ef8587c8c4c2e6ff3515080ab3544d6a4af8 Mon Sep 17 00:00:00 2001 From: punam biswal Date: Fri, 27 Feb 2026 17:10:38 +0530 Subject: [PATCH] Read configurations from env file Signed-off-by: punam biswal --- device-discovery-agent/VERSION | 2 +- device-discovery-agent/debian/config | 22 ------ .../debian/device-discovery-agent.service | 1 + device-discovery-agent/debian/postinst | 51 ++++++-------- device-discovery-agent/debian/templates | 64 ----------------- node-agent/VERSION | 2 +- node-agent/debian/config | 20 ------ .../debian/node-agent.node-agent.service | 1 + node-agent/debian/postinst | 69 ++++++++----------- node-agent/debian/templates | 64 ----------------- platform-manageability-agent/VERSION | 2 +- .../platform-manageability-agent.service | 1 + platform-manageability-agent/debian/postinst | 18 ++--- platform-manageability-agent/debian/templates | 14 ---- 14 files changed, 61 insertions(+), 270 deletions(-) delete mode 100644 device-discovery-agent/debian/config delete mode 100644 device-discovery-agent/debian/templates delete mode 100644 node-agent/debian/config delete mode 100644 node-agent/debian/templates delete mode 100644 platform-manageability-agent/debian/templates diff --git a/device-discovery-agent/VERSION b/device-discovery-agent/VERSION index ccf3e968..bbdeab62 100644 --- a/device-discovery-agent/VERSION +++ b/device-discovery-agent/VERSION @@ -1 +1 @@ -0.0.5-dev +0.0.5 diff --git a/device-discovery-agent/debian/config b/device-discovery-agent/debian/config deleted file mode 100644 index 0e73a634..00000000 --- a/device-discovery-agent/debian/config +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -set -e - -. /usr/share/debconf/confmodule - -# High priority prompts (critical configuration) -db_input high device-discovery-agent/onboarding.serviceURL || true -db_input high device-discovery-agent/onboarding.servicePort || true -db_input high device-discovery-agent/discovery.serviceURL || true -db_input high device-discovery-agent/auth.keycloakURL || true -db_input medium device-discovery-agent/onboarding.caCertPath || true - -# Medium priority prompts (operational settings) -db_input medium device-discovery-agent/sysinfo.autoDetect || true -db_input medium device-discovery-agent/debug || true - -# Low priority prompts (advanced options) -db_input low device-discovery-agent/disableInteractive || true -db_input low device-discovery-agent/useKernelArgs || true - -db_go || true diff --git a/device-discovery-agent/debian/device-discovery-agent.service b/device-discovery-agent/debian/device-discovery-agent.service index 46981075..16aadcd5 100644 --- a/device-discovery-agent/debian/device-discovery-agent.service +++ b/device-discovery-agent/debian/device-discovery-agent.service @@ -6,6 +6,7 @@ Wants=network-online.target [Service] Type=oneshot +EnvironmentFile=/etc/edge-node/node/agent_variables ExecStart=/opt/edge-node/bin/device-discovery-agent -config /etc/edge-node/node/confs/device-discovery-agent.env StandardOutput=journal StandardError=journal diff --git a/device-discovery-agent/debian/postinst b/device-discovery-agent/debian/postinst index 675ad8af..7b805bb6 100755 --- a/device-discovery-agent/debian/postinst +++ b/device-discovery-agent/debian/postinst @@ -1,59 +1,48 @@ #!/bin/bash -e -. /usr/share/debconf/confmodule - # Update onboarding service URL (OBM_SVC) -db_get device-discovery-agent/onboarding.serviceURL -if [ ! -z "$RET" ]; then - sed -i "s|^OBM_SVC=.*|OBM_SVC=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env +if [ ! -z "$ONBOARDING_SVC_URL" ]; then + sed -i "s|^OBM_SVC=.*|OBM_SVC=$ONBOARDING_SVC_URL|" /etc/edge-node/node/confs/device-discovery-agent.env fi # Update onboarding service port (OBM_PORT) -db_get device-discovery-agent/onboarding.servicePort -if [ ! -z "$RET" ]; then - sed -i "s|^OBM_PORT=.*|OBM_PORT=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env +if [ ! -z "$ONBOARDING_SVC_PORT" ]; then + sed -i "s|^OBM_PORT=.*|OBM_PORT=$ONBOARDING_SVC_PORT|" /etc/edge-node/node/confs/device-discovery-agent.env fi -# Update discovery service URL (OBS_SVC) -db_get device-discovery-agent/discovery.serviceURL -if [ ! -z "$RET" ]; then - sed -i "s|^OBS_SVC=.*|OBS_SVC=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env +# Update onboarding stream service URL (OBS_SVC) +if [ ! -z "$ONBOARDING_STREAM_SVC_URL" ]; then + sed -i "s|^OBS_SVC=.*|OBS_SVC=$ONBOARDING_STREAM_SVC_URL|" /etc/edge-node/node/confs/device-discovery-agent.env fi -# Update Keycloak URL (KEYCLOAK_URL) -db_get device-discovery-agent/auth.keycloakURL -if [ ! -z "$RET" ]; then - sed -i "s|^KEYCLOAK_URL=.*|KEYCLOAK_URL=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env +# Update keycloak URL (KEYCLOAK_URL) +if [ ! -z "$KEYCLOAK_URL" ]; then + sed -i "s|^KEYCLOAK_URL=.*|KEYCLOAK_URL=$KEYCLOAK_URL|" /etc/edge-node/node/confs/device-discovery-agent.env fi # Update CA certificate path (CA_CERT) -db_get device-discovery-agent/onboarding.caCertPath -if [ ! -z "$RET" ]; then - sed -i "s|^CA_CERT=.*|CA_CERT=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env +if [ ! -z "$CA_PEM" ]; then + sed -i "s|^CA_CERT=.*|CA_CERT=$CA_PEM|" /etc/edge-node/node/confs/device-discovery-agent.env fi # Update auto-detect setting (AUTO_DETECT) -db_get device-discovery-agent/sysinfo.autoDetect -if [ ! -z "$RET" ]; then - sed -i "s|^AUTO_DETECT=.*|AUTO_DETECT=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env +if [ ! -z "$AUTO_DETECT" ]; then + sed -i "s|^AUTO_DETECT=.*|AUTO_DETECT=$AUTO_DETECT|" /etc/edge-node/node/confs/device-discovery-agent.env fi # Update debug mode (DEBUG) -db_get device-discovery-agent/debug -if [ ! -z "$RET" ]; then - sed -i "s|^DEBUG=.*|DEBUG=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env +if [ ! -z "$DEBUG" ]; then + sed -i "s|^DEBUG=.*|DEBUG=$DEBUG|" /etc/edge-node/node/confs/device-discovery-agent.env fi # Update disable interactive mode (DISABLE_INTERACTIVE) -db_get device-discovery-agent/disableInteractive -if [ ! -z "$RET" ]; then - sed -i "s|^DISABLE_INTERACTIVE=.*|DISABLE_INTERACTIVE=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env +if [ ! -z "$DISABLE_INTERACTIVE" ]; then + sed -i "s|^DISABLE_INTERACTIVE=.*|DISABLE_INTERACTIVE=$DISABLE_INTERACTIVE|" /etc/edge-node/node/confs/device-discovery-agent.env fi # Update use kernel args (USE_KERNEL_ARGS) -db_get device-discovery-agent/useKernelArgs -if [ ! -z "$RET" ]; then - sed -i "s|^USE_KERNEL_ARGS=.*|USE_KERNEL_ARGS=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env +if [ ! -z "$KERNEL_ARGS" ]; then + sed -i "s|^USE_KERNEL_ARGS=.*|USE_KERNEL_ARGS=$KERNEL_ARGS|" /etc/edge-node/node/confs/device-discovery-agent.env fi # Read hardware serial number and update config diff --git a/device-discovery-agent/debian/templates b/device-discovery-agent/debian/templates deleted file mode 100644 index d90d2268..00000000 --- a/device-discovery-agent/debian/templates +++ /dev/null @@ -1,64 +0,0 @@ -Template: device-discovery-agent/onboarding.serviceURL -Type: string -Default: localhost -Description: Onboarding Manager Service URL (hostname or IP): - The address of the onboarding manager service where the device will register. - Do not include port number (configured separately). - Example: obm.example.com or 192.168.1.100 - -Template: device-discovery-agent/onboarding.servicePort -Type: string -Default: 50051 -Description: Onboarding Manager Service Port: - The port number for the onboarding manager service. - Example: 50051 - -Template: device-discovery-agent/discovery.serviceURL -Type: string -Default: localhost -Description: Onboarding Stream Service URL (hostname or IP): - The address of the onboarding stream service for device discovery. - Do not include port number. - Example: obs.example.com or 192.168.1.101 - -Template: device-discovery-agent/auth.keycloakURL -Type: string -Default: keycloak.example.com -Description: Keycloak authentication URL: - The URL of the Keycloak server for device authentication. - Example: keycloak.example.com or auth.example.com - -Template: device-discovery-agent/onboarding.caCertPath -Type: string -Default: /etc/intel_edge_node/orch-ca-cert/orch-ca.pem -Description: CA certificate path: - Path to the CA certificate file for TLS verification. - Example: /etc/intel_edge_node/orch-ca-cert/orch-ca.pem - -Template: device-discovery-agent/sysinfo.autoDetect -Type: boolean -Default: true -Description: Auto-detect system information? - Enable automatic detection of MAC address, serial number, UUID, and IP address. - If disabled, you must provide these values manually. - -Template: device-discovery-agent/debug -Type: boolean -Default: false -Description: Enable debug mode? - Enable debug mode with extended logging and timeout. - Useful for troubleshooting but not recommended for production. - -Template: device-discovery-agent/disableInteractive -Type: boolean -Default: false -Description: Disable interactive mode fallback? - When enabled, if non-interactive mode fails, the agent will not fall back to interactive mode. - If disabled, the agent will attempt interactive mode as a fallback. - -Template: device-discovery-agent/useKernelArgs -Type: boolean -Default: false -Description: Use kernel command line arguments for configuration? - When enabled, the agent will read configuration from /proc/cmdline. - This is useful for cloud-init or boot-time configuration scenarios. diff --git a/node-agent/VERSION b/node-agent/VERSION index 3bf213d7..18b31142 100644 --- a/node-agent/VERSION +++ b/node-agent/VERSION @@ -1 +1 @@ -1.10.4-dev +1.10.4 diff --git a/node-agent/debian/config b/node-agent/debian/config deleted file mode 100644 index fc1aec66..00000000 --- a/node-agent/debian/config +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -set -e - -. /usr/share/debconf/confmodule - -db_input high node-agent/onboarding.serviceURL || true -db_input low node-agent/onboarding.enabled || true -db_input low node-agent/onboarding.heartbeatInterval || true -db_input low node-agent/status.serviceClients || true -db_input low node-agent/status.outboundClients || true -db_input low node-agent/metrics.enabled || true -db_input low node-agent/auth.accessTokenURL || true -db_input low node-agent/auth.rsTokenURL || true -db_input low node-agent/auth.tokenClients || true -db_input low node-agent/proxy.aptSourceURL || true -db_input low node-agent/proxy.aptSourceProxyPort || true -db_input low node-agent/proxy.aptSourceFilesRSRoot || true -db_input low node-agent/auth.RSType || true -db_go || true diff --git a/node-agent/debian/node-agent.node-agent.service b/node-agent/debian/node-agent.node-agent.service index 4c4bbabb..0eabd86b 100644 --- a/node-agent/debian/node-agent.node-agent.service +++ b/node-agent/debian/node-agent.node-agent.service @@ -4,6 +4,7 @@ Documentation=https://github.com/open-edge-platform/edge-node-agents/blob/main/n [Service] EnvironmentFile=/etc/environment +EnvironmentFile=/etc/edge-node/node/agent_variables ExecStart=/opt/edge-node/bin/node-agent -config /etc/edge-node/node/confs/node-agent.yaml StandardOutput=journal StandardError=journal diff --git a/node-agent/debian/postinst b/node-agent/debian/postinst index 29f99a67..a7fcf648 100644 --- a/node-agent/debian/postinst +++ b/node-agent/debian/postinst @@ -1,25 +1,21 @@ #!/bin/bash -e -. /usr/share/debconf/confmodule +# Source agent variables from file created by Installer -db_get node-agent/onboarding.enabled -if [ ! -z "$RET" ]; then - sed -i -e '/^onboarding:$/{n' -e 's/enabled:.*/enabled: '"$RET"'/' -e '}' /etc/edge-node/node/confs/node-agent.yaml +if [ ! -z "$NODE_ONBOARDING_ENABLED" ]; then + sed -i -e '/^onboarding:$/{n' -e 's/enabled:.*/enabled: '"$NODE_ONBOARDING_ENABLED"'/' -e '}' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/onboarding.serviceURL -if [ ! -z "$RET" ]; then - sed -i -e '/^onboarding:$/{n' -e '/.*enabled:/{n' -e 's#serviceURL:.*#serviceURL: '"$RET"'#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml +if [ ! -z "$NODE_ONBOARDING_URL" ]; then + sed -i -e '/^onboarding:$/{n' -e '/.*enabled:/{n' -e 's#serviceURL:.*#serviceURL: '"$NODE_ONBOARDING_URL"'#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/onboarding.heartbeatInterval -if [ ! -z "$RET" ]; then - sed -i -e '/^onboarding:$/{n' -e '/.*enabled:/{n' -e '/.*serviceURL:/{n' -e 's/heartbeatInterval:.*/heartbeatInterval: '"$RET"'/' -e '}}}' /etc/edge-node/node/confs/node-agent.yaml +if [ ! -z "$NODE_ONBOARDING_HEARTBEAT" ]; then + sed -i -e '/^onboarding:$/{n' -e '/.*enabled:/{n' -e '/.*serviceURL:/{n' -e 's/heartbeatInterval:.*/heartbeatInterval: '"$NODE_ONBOARDING_HEARTBEAT"'/' -e '}}}' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/status.serviceClients -if [ ! -z "$RET" ]; then - IFS=',' read -r -a serviceClientArray <<< "$RET" +if [ ! -z "$NODE_SERVICE_CLIENTS" ]; then + IFS=',' read -r -a serviceClientArray <<< "$NODE_SERVICE_CLIENTS" arrayLength=${#serviceClientArray[@]} agentList="" index=0 @@ -34,9 +30,8 @@ if [ ! -z "$RET" ]; then sed -i -e '/^status:$/{n' -e '/.*endpoint:/{n' -e 's#serviceClients:.*#serviceClients: [ '"${agentList}"' ]#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/status.outboundClients -if [ ! -z "$RET" ]; then - IFS=',' read -r -a outboundClientArray <<< "$RET" +if [ ! -z "$NODE_OUTBOUND_CLIENTS" ]; then + IFS=',' read -r -a outboundClientArray <<< "$NODE_OUTBOUND_CLIENTS" arrayLength=${#outboundClientArray[@]} agentList="" index=0 @@ -51,24 +46,20 @@ if [ ! -z "$RET" ]; then sed -i -e '/^status:$/{n' -e '/.*endpoint:/{n' -e '/.*serviceClients:/{n' -e 's#outboundClients:.*#outboundClients: [ '"${agentList}"' ]#' -e '}}}' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/metrics.enabled -if [ ! -z "$RET" ]; then - sed -i -e '/^metrics:$/{n' -e 's/enabled:.*/enabled: '"$RET"'/' -e '}' /etc/edge-node/node/confs/node-agent.yaml +if [ ! -z "$NODE_METRICS_ENABLED" ]; then + sed -i -e '/^metrics:$/{n' -e 's/enabled:.*/enabled: '"$NODE_METRICS_ENABLED"'/' -e '}' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/auth.accessTokenURL -if [ ! -z "$RET" ]; then - sed -i -e '/^auth:$/{n' -e 's#accessTokenURL:.*#accessTokenURL: '"$RET"'#' -e '}' /etc/edge-node/node/confs/node-agent.yaml +if [ ! -z "$NODE_ACCESS_URL" ]; then + sed -i -e '/^auth:$/{n' -e 's#accessTokenURL:.*#accessTokenURL: '"$NODE_ACCESS_URL"'#' -e '}' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/auth.rsTokenURL -if [ ! -z "$RET" ]; then - sed -i -e '/^auth:$/{n' -e '/.*accessTokenURL:/{n' -e 's#rsTokenURL:.*#rsTokenURL: '"$RET"'#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml +if [ ! -z "$NODE_RS_URL" ]; then + sed -i -e '/^auth:$/{n' -e '/.*accessTokenURL:/{n' -e 's#rsTokenURL:.*#rsTokenURL: '"$NODE_RS_URL"'#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/auth.tokenClients -if [ ! -z "$RET" ]; then - IFS=',' read -r -a tokenClientArray <<< "$RET" +if [ ! -z "$NODE_TOKEN_CLIENTS" ]; then + IFS=',' read -r -a tokenClientArray <<< "$NODE_TOKEN_CLIENTS" arrayLength=${#tokenClientArray[@]} agentList="" index=0 @@ -83,29 +74,25 @@ if [ ! -z "$RET" ]; then sed -i -e '/^auth:$/{n' -e '/.*accessTokenURL:/{n' -e '/.*rsTokenURL:/{n' -e '/.*accessTokenPath:/{n' -e '/.*clientCredsPath:/{n' -e 's#tokenClients:.*#tokenClients: [ '"${agentList}"' ]#' -e '}}}}}' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/proxy.aptSourceURL -if [ ! -z "$RET" ]; then - sed -i -e 's#reverse_proxy.*#reverse_proxy https://'"$RET"' {#' /etc/caddy/pua.caddy +if [ ! -z "$CADDY_APT_PROXY_URL" ]; then + sed -i -e 's#reverse_proxy.*#reverse_proxy https://'"$CADDY_APT_PROXY_URL"' {#' /etc/caddy/pua.caddy fi -db_get node-agent/proxy.aptSourceProxyPort -if [ ! -z "$RET" ]; then - sed -i -e 's#localhost.*#localhost:'"$RET"' {#' /etc/caddy/pua.caddy - sed -i -E '/name: client-proxy/,/url:/ s|(http://[^:]+:)[0-9]+|\1'"$RET"'|' /etc/edge-node/node/confs/node-agent.yaml +if [ ! -z "$CADDY_APT_PROXY_PORT" ]; then + sed -i -e 's#localhost.*#localhost:'"$CADDY_APT_PROXY_PORT"' {#' /etc/caddy/pua.caddy + sed -i -E '/name: client-proxy/,/url:/ s|(http://[^:]+:)[0-9]+|\1'"$CADDY_APT_PROXY_PORT"'|' /etc/edge-node/node/confs/node-agent.yaml fi -db_get node-agent/proxy.aptSourceFilesRSRoot -if [ ! -z "$RET" ]; then - sed -i -E '/name: client-proxy/,/url:/ s|(http://[^/]+/)[^/]+|\1'"$RET"'|' /etc/edge-node/node/confs/node-agent.yaml +if [ ! -z "$FILE_RS_ROOT" ]; then + sed -i -E '/name: client-proxy/,/url:/ s|(http://[^/]+/)[^/]+|\1'"$FILE_RS_ROOT"'|' /etc/edge-node/node/confs/node-agent.yaml fi if ! grep -q "EnvironmentFile" "/lib/systemd/system/caddy.service"; then sed -i '/^\[Service\]$/a EnvironmentFile=\/etc\/environment' /lib/systemd/system/caddy.service fi -db_get node-agent/auth.RSType -if [ ! -z "$RET" ]; then - if [ "$RET" == "no-auth" ]; then +if [ ! -z "$RS_TYPE" ]; then + if [ "$RS_TYPE" == "no-auth" ]; then sed -i -e '/header_up Authorization.*/d' /etc/caddy/pua.caddy fi fi diff --git a/node-agent/debian/templates b/node-agent/debian/templates deleted file mode 100644 index 7194ac24..00000000 --- a/node-agent/debian/templates +++ /dev/null @@ -1,64 +0,0 @@ -Template: node-agent/onboarding.serviceURL -Type: string -Default: localhost:443 -Description: Onboarding service URL: - -Template: node-agent/onboarding.enabled -Type: boolean -Default: true -Description: Onboarding service Heartbeat enabled: - -Template: node-agent/onboarding.heartbeatInterval -Type: string -Default: 10s -Description: Onboarding service Heartbeat interval: - -Template: node-agent/status.serviceClients -Type: string -Default: hardware-discovery-agent,cluster-agent,platform-manageability-agent,platform-update-agent,platform-telemetry-agent -Description: List of agents to provide status reports: - -Template: node-agent/status.outboundClients -Type: string -Default: platform-observability-collector,platform-observability-health-check,platform-observability-logging,platform-observability-metrics -Description: List of services to perform status checks on: - -Template: node-agent/metrics.enabled -Type: string -Default: true -Description: Metrics reporting enabled: - -Template: node-agent/auth.accessTokenURL -Type: string -Default: localhost:443 -Description: Orchestrator access token URL: - -Template: node-agent/auth.rsTokenURL -Type: string -Default: localhost:443 -Description: Release service token URL: - -Template: node-agent/auth.tokenClients -Type: string -Default: node-agent,hd-agent,cluster-agent,platform-update-agent,platform-observability-agent,platform-telemetry-agent,prometheus,connect-agent,attestation-manager,platform-manageability-agent -Description: List of services requiring token management: - -Template: node-agent/proxy.aptSourceURL -Type: string -Default: localhost:443 -Description: Apt source URL: - -Template: node-agent/proxy.aptSourceProxyPort -Type: string -Default: 60444 -Description: Apt source proxy port: - -Template: node-agent/proxy.aptSourceFilesRSRoot -Type: string -Default: files-edge-orch -Description: Apt source files root: - -Template: node-agent/auth.RSType -Type: string -Default: auth -Description: Registry type: \ No newline at end of file diff --git a/platform-manageability-agent/VERSION b/platform-manageability-agent/VERSION index 4d08f855..ef52a648 100644 --- a/platform-manageability-agent/VERSION +++ b/platform-manageability-agent/VERSION @@ -1 +1 @@ -0.4.6-dev +0.4.6 diff --git a/platform-manageability-agent/debian/platform-manageability-agent.service b/platform-manageability-agent/debian/platform-manageability-agent.service index 0512f7ec..9e664961 100644 --- a/platform-manageability-agent/debian/platform-manageability-agent.service +++ b/platform-manageability-agent/debian/platform-manageability-agent.service @@ -3,6 +3,7 @@ Description=Platform Manageability Agent Documentation=https://github.com/open-edge-platform/edge-node-agents/blob/main/platform-manageability-agent/README.md [Service] +EnvironmentFile=/etc/edge-node/node/agent_variables ExecStart=/opt/edge-node/bin/pm-agent -config /etc/edge-node/node/confs/platform-manageability-agent.yaml StandardOutput=journal StandardError=journal diff --git a/platform-manageability-agent/debian/postinst b/platform-manageability-agent/debian/postinst index b8fc91a7..6836288e 100644 --- a/platform-manageability-agent/debian/postinst +++ b/platform-manageability-agent/debian/postinst @@ -2,21 +2,17 @@ set -e -. /usr/share/debconf/confmodule - -db_get platform-manageability-agent/manageability.serviceURL -if [ ! -z "$RET" ]; then - sed -i "s/^ serviceURL: '.*'/ serviceURL: '$RET'/" /etc/edge-node/node/confs/platform-manageability-agent.yaml +# Source agent variables from file created by Installer +if [ ! -z "$PLATFORM_MANAGEABILITY_URL" ]; then + sed -i "s/^ serviceURL: '.*'/ serviceURL: '$PLATFORM_MANAGEABILITY_URL'/" /etc/edge-node/node/confs/platform-manageability-agent.yaml fi -db_get platform-manageability-agent/rpsAddress -if [ ! -z "$RET" ]; then - sed -i "s/^rpsAddress: '.*'/rpsAddress: '$RET'/" /etc/edge-node/node/confs/platform-manageability-agent.yaml +if [ ! -z "$RPS_ADDRESS" ]; then + sed -i "s/^rpsAddress: '.*'/rpsAddress: '$RPS_ADDRESS'/" /etc/edge-node/node/confs/platform-manageability-agent.yaml fi -db_get platform-manageability-agent/metrics.enabled -if [ ! -z "$RET" ]; then - sed -i -e '/^metrics:$/{n' -e 's/enabled:.*/enabled: '"$RET"'/' -e '}' /etc/edge-node/node/confs/platform-manageability-agent.yaml +if [ ! -z "$NODE_METRICS_ENABLED" ]; then + sed -i -e '/^metrics:$/{n' -e 's/enabled:.*/enabled: '"$NODE_METRICS_ENABLED"'/' -e '}' /etc/edge-node/node/confs/platform-manageability-agent.yaml fi # Create system group if it doesn't exist diff --git a/platform-manageability-agent/debian/templates b/platform-manageability-agent/debian/templates deleted file mode 100644 index 96d6f135..00000000 --- a/platform-manageability-agent/debian/templates +++ /dev/null @@ -1,14 +0,0 @@ -Template: platform-manageability-agent/manageability.serviceURL -Type: string -Default: localhost:443 -Description: Onboarding service URL: - -Template: platform-manageability-agent/rpsAddress -Type: string -Default: localhost -Description: RPS address: - -Template: platform-manageability-agent/metrics.enabled -Type: string -Default: true -Description: Metrics reporting enabled: \ No newline at end of file