anchor.diff:    notify
   }
   
  +check_if_ec2()
  +{
  +  if [ -f /sys/hypervisor/uuid ] && [ `head -c 3 /sys/hypervisor/uuid` == ec2 ]; then
  +    return 0
  +  else
  +    return 1
  +  fi
  +}
  +
  +get_fqdn_from_hostname()
  +{
  +  # Try collecting fqdn if it is set correctly
  +  fqdn=$(/bin/hostname -f)
  +  if [ -n "${fqdn}" ]; then
  +    EXTERNAL_URL="http://${fqdn}"
  +  fi
  +}
  +
  +get_ec2_hostname()
  +{
  +  # Try collecting fqdn if it is set correctly
  +  fqdn=$(/opt/gitlab/embedded/bin/curl -s http://169.254.169.254/latest/meta-data/public-hostname)
  +  if [ -n "${fqdn}" ]; then
  +    EXTERNAL_URL="http://${fqdn}"
  +  fi
  +}
  +
   if [ -n "${GITLAB_DEBUG}" ] ; then
     notify "debug: arguments: $@"
  +fi
  +
  +check_if_ec2
  +if [ $? -eq 0 ]  ; then
  +  get_ec2_hostname
  +else
  +  get_fqdn_from_hostname
   fi
   
   create_symlinks
  
positive.code:   if ! [ -e /etc/gitlab/gitlab.rb ] ; then
      mkdir -p /etc/gitlab
      cp "${DEST_DIR}/etc/gitlab.rb.template" /etc/gitlab/gitlab.rb
      sed -i 's!GENERATED_EXTERNAL_URL!'$external_url'!g' /etc/gitlab/gitlab.rb
      chmod 600 /etc/gitlab/gitlab.rb
    fi
  }
  
negative.code: 
  PROGNAME=$(basename $0)
  DEST_DIR=<%= install_dir %>
  EXTERNAL_URL="http://gitlab.example.com"
  usr_bin_symlinks="\
    ${DEST_DIR}/bin/gitlab-ctl \
    ${DEST_DIR}/bin/gitlab-rake \
  