From 332545fc28c8a98c050a11b184f479d5b41b3e51 Mon Sep 17 00:00:00 2001 From: Troy Ready Date: Sun, 22 Oct 2017 12:04:30 -0700 Subject: [PATCH] Avoid "key not found" errors if not on EC2 --- attributes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index cc74230..31dfd18 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,7 +1,7 @@ default['ssm_agent'].tap do |config| # Attempt to detect the current region from Ohai # @since 0.1.0 - aws_az = node.fetch('ec2', {}).fetch('placement_availability_zone') + aws_az = node.fetch('ec2', {}).fetch('placement_availability_zone', nil) config['region'] = aws_az ? aws_az[0..-2] : 'us-east-1' # Version of the package to download and install