Merge pull request #7182 from justinsb/aws_fix_hostname

AWS: Set hostname_override for minions, back to fully-qualified name
pull/6/head
CJ Cullen 2015-04-22 14:13:53 -07:00
commit 924015dc94
1 changed files with 12 additions and 0 deletions

View File

@ -30,6 +30,18 @@ grains:
cloud: aws
EOF
# We set the hostname_override to the full EC2 private dns name
# we'd like to use EC2 instance-id, but currently the kubelet health-check assumes the name
# is resolvable, although that check should be going away entirely (#7092)
if [[ -z "${HOSTNAME_OVERRIDE}" ]]; then
HOSTNAME_OVERRIDE=`curl --silent curl http://169.254.169.254/2007-01-19/meta-data/local-hostname`
fi
if [[ -n "${HOSTNAME_OVERRIDE}" ]]; then
cat <<EOF >>/etc/salt/minion.d/grains.conf
hostname_override: "${HOSTNAME_OVERRIDE}"
EOF
fi
if [[ -n "${DOCKER_OPTS}" ]]; then
cat <<EOF >>/etc/salt/minion.d/grains.conf