Blame SOURCES/bz1940094-aws-agents-dont-spam-logs.patch

0c4b27
From 59b0840d262900d0eaa8b19df3ede55eea5250d2 Mon Sep 17 00:00:00 2001
0c4b27
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
0c4b27
Date: Wed, 17 Mar 2021 12:10:59 +0100
0c4b27
Subject: [PATCH] AWS agents: dont spam log files when getting token
0c4b27
0c4b27
---
0c4b27
 heartbeat/aws-vpc-move-ip    | 2 +-
0c4b27
 heartbeat/aws-vpc-route53.in | 2 +-
0c4b27
 heartbeat/awseip             | 2 +-
0c4b27
 heartbeat/awsvip             | 2 +-
0c4b27
 4 files changed, 4 insertions(+), 4 deletions(-)
0c4b27
0c4b27
diff --git a/heartbeat/aws-vpc-move-ip b/heartbeat/aws-vpc-move-ip
0c4b27
index cbb629b00..3ca3d6bd6 100755
0c4b27
--- a/heartbeat/aws-vpc-move-ip
0c4b27
+++ b/heartbeat/aws-vpc-move-ip
0c4b27
@@ -215,7 +215,7 @@ ec2ip_validate() {
0c4b27
 		return $OCF_ERR_CONFIGURED
0c4b27
 	fi
0c4b27
 
0c4b27
-	TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
0c4b27
+	TOKEN=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
0c4b27
 	EC2_INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id -H "X-aws-ec2-metadata-token: $TOKEN")
0c4b27
 
0c4b27
 	if [ -z "${EC2_INSTANCE_ID}" ]; then
0c4b27
diff --git a/heartbeat/aws-vpc-route53.in b/heartbeat/aws-vpc-route53.in
0c4b27
index 4fb17019b..21948eaca 100644
0c4b27
--- a/heartbeat/aws-vpc-route53.in
0c4b27
+++ b/heartbeat/aws-vpc-route53.in
0c4b27
@@ -347,7 +347,7 @@ r53_monitor() {
0c4b27
 _get_ip() {
0c4b27
 	case $OCF_RESKEY_ip in
0c4b27
 		local|public)
0c4b27
-			TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
0c4b27
+			TOKEN=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
0c4b27
 			IPADDRESS=$(curl -s http://169.254.169.254/latest/meta-data/${OCF_RESKEY_ip}-ipv4 -H "X-aws-ec2-metadata-token: $TOKEN");;
0c4b27
 		*.*.*.*)
0c4b27
 			IPADDRESS="${OCF_RESKEY_ip}";;
0c4b27
diff --git a/heartbeat/awseip b/heartbeat/awseip
0c4b27
index de1967774..12ffffaa3 100755
0c4b27
--- a/heartbeat/awseip
0c4b27
+++ b/heartbeat/awseip
0c4b27
@@ -244,7 +244,7 @@ AWSCLI="${OCF_RESKEY_awscli}"
0c4b27
 ELASTIC_IP="${OCF_RESKEY_elastic_ip}"
0c4b27
 ALLOCATION_ID="${OCF_RESKEY_allocation_id}"
0c4b27
 PRIVATE_IP_ADDRESS="${OCF_RESKEY_private_ip_address}"
0c4b27
-TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
0c4b27
+TOKEN=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
0c4b27
 INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id -H "X-aws-ec2-metadata-token: $TOKEN")
0c4b27
 
0c4b27
 case $__OCF_ACTION in
0c4b27
diff --git a/heartbeat/awsvip b/heartbeat/awsvip
0c4b27
index 8050107e8..7d0bf35b6 100755
0c4b27
--- a/heartbeat/awsvip
0c4b27
+++ b/heartbeat/awsvip
0c4b27
@@ -206,7 +206,7 @@ esac
0c4b27
 
0c4b27
 AWSCLI="${OCF_RESKEY_awscli}"
0c4b27
 SECONDARY_PRIVATE_IP="${OCF_RESKEY_secondary_private_ip}"
0c4b27
-TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
0c4b27
+TOKEN=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
0c4b27
 INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id -H "X-aws-ec2-metadata-token: $TOKEN")
0c4b27
 MAC_ADDRESS=$(curl -s http://169.254.169.254/latest/meta-data/mac -H "X-aws-ec2-metadata-token: $TOKEN")
0c4b27
 NETWORK_ID=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MAC_ADDRESS}/interface-id -H "X-aws-ec2-metadata-token: $TOKEN")