From ef44f22d899ded52254b149892ec6074c576d240 Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Wed, 6 Mar 2024 22:34:13 +0100 Subject: [PATCH] templates/packer: vector expects a yaml configuration now When switching to the new vector repos, the version was also bumped. The newer versions expect a yaml config. --- .../worker-initialization-scripts/vector.sh | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/templates/packer/ansible/roles/common/files/worker-initialization-scripts/vector.sh b/templates/packer/ansible/roles/common/files/worker-initialization-scripts/vector.sh index 7cc1f7b1a..9bb0f4617 100755 --- a/templates/packer/ansible/roles/common/files/worker-initialization-scripts/vector.sh +++ b/templates/packer/ansible/roles/common/files/worker-initialization-scripts/vector.sh @@ -7,19 +7,23 @@ echo "Writing vector config." REGION=$(curl -Ls http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region) sudo mkdir -p /etc/vector -sudo tee /etc/vector/vector.toml > /dev/null << EOF -[sources.journald] -type = "journald" -exclude_units = ["vector.service"] - -[sinks.out] -type = "aws_cloudwatch_logs" -inputs = [ "journald" ] -region = "${REGION}" -endpoint = "${CLOUDWATCH_LOGS_ENDPOINT_URL}" -group_name = "${CLOUDWATCH_LOG_GROUP}" -stream_name = "worker_syslog_{{ host }}" -encoding.codec = "json" +sudo tee /etc/vector/vector.yaml > /dev/null << EOF +sources: + journald: + type: journald + exclude_units: + - vector.service +sinks: + out: + type: aws_cloudwatch_logs + inputs: + - journald + region: ${REGION} + endpoint: ${CLOUDWATCH_LOGS_ENDPOINT_URL} + group_name: ${CLOUDWATCH_LOG_GROUP} + stream_name: worker_syslog_{{ host }} + encoding: + codec: json EOF sudo systemctl enable --now vector