diff --git a/cookbooks/nginx/attributes/binary.bash b/cookbooks/nginx/attributes/binary.bash index 0b136ec3..c37bc1b2 100644 --- a/cookbooks/nginx/attributes/binary.bash +++ b/cookbooks/nginx/attributes/binary.bash @@ -1,3 +1,6 @@ #!/bin/bash -e -export NGINX_PORT='80' \ No newline at end of file +export NGINX_PORT='80' + +export AMAZON_LINUX_DEFAULT_ID='centos' +export AMAZON_LINUX_DEFAULT_VERSION='7' \ No newline at end of file diff --git a/cookbooks/nginx/recipes/install-from-binary.bash b/cookbooks/nginx/recipes/install-from-binary.bash index 960a4861..8af7f7d1 100755 --- a/cookbooks/nginx/recipes/install-from-binary.bash +++ b/cookbooks/nginx/recipes/install-from-binary.bash @@ -26,6 +26,16 @@ function install() source "${releaseFilePath}" + # Set ID For Amazon Linux + + if [[ "${ID}" = 'amzn' ]] + then + ID="${AMAZON_LINUX_DEFAULT_ID}" + VERSION_ID="${AMAZON_LINUX_DEFAULT_VERSION_ID}" + fi + + # Generate Repo File + local -r configData=( '__PLATFORM_FAMILY__' "${ID}" '__PLATFORM_VERSION__' "$(awk -F '.' '{ print $1 }' <<< "${VERSION_ID}")"