From f660ed65b6a95ce791bf7230e83151e0d0c39bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Fri, 8 Mar 2024 20:29:29 +0100 Subject: [PATCH] Packer: remove escaped newline from worker config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the /tmp/cloud_init_vars contained OSBUILD_EXECUTOR_CLOUDWATCH_GROUP variable set, the worker configuration file would contain a line with escaped newline character at the end of the value configuring `cloudwatch_group` for the `osbuild_executor`. This makes the worker fail to start when loading the configuration. Remove the newline from the value appended to the worker config by the initialization script. Fix #4001 Signed-off-by: Tomáš Hozza --- .../common/files/worker-initialization-scripts/worker_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/packer/ansible/roles/common/files/worker-initialization-scripts/worker_config.sh b/templates/packer/ansible/roles/common/files/worker-initialization-scripts/worker_config.sh index 1ab30d7be..5592f4afc 100755 --- a/templates/packer/ansible/roles/common/files/worker-initialization-scripts/worker_config.sh +++ b/templates/packer/ansible/roles/common/files/worker-initialization-scripts/worker_config.sh @@ -9,7 +9,7 @@ OSBUILD_EXECUTOR_CLOUDWATCH_GROUP=${OSBUILD_EXECUTOR_CLOUDWATCH_GROUP:-} CLOUDWATCH_GROUP_CONFIG="" if [ -n "${OSBUILD_EXECUTOR_CLOUDWATCH_GROUP}" ]; then - CLOUDWATCH_GROUP_CONFIG="cloudwatch_group = \"${OSBUILD_EXECUTOR_CLOUDWATCH_GROUP}\"\n" + CLOUDWATCH_GROUP_CONFIG="cloudwatch_group = \"${OSBUILD_EXECUTOR_CLOUDWATCH_GROUP}\"" fi sudo tee -a /etc/osbuild-worker/osbuild-worker.toml > /dev/null << EOF