---
<%
  def discover_external_ip
    networks = spec.networks.marshal_dump
    _, network = networks.find do |_name, network_spec|
      network_spec.default
    end
    if !network
      _, network = networks.first
    end
    if !network
      raise "Could not determine IP via network spec: #{networks}"
    end
    network.ip
  end
  ip = discover_external_ip
%>

message_bus_servers:
<% for machine in p('cf.nats.machines') %>
  - host: <%= machine %>:<%= p('cf.nats.port') %>
    user: <%= p('cf.nats.username') %>
    password: <%= p('cf.nats.password') %>
<% end %>
host: <%= p('redis.broker.subdomain') %>.<%= p('cf.apps_domain') %>
external_ip: <%= ip %>
port: <%= p('redis.broker.nginx.port') %>
health_checker:
  name: redis-broker
  interval_in_seconds: 10

---
<%
  def discover_external_ip
    networks = spec.networks.marshal_dump
    _, network = networks.find do |_name, network_spec|
      network_spec.default
    end
    if !network
      _, network = networks.first
    end
    if !network
      raise "Could not determine IP via network spec: #{networks}"
    end
    network.ip
  end
  ip = discover_external_ip
%>

message_bus_servers:
<% for machine in p('cf.nats.machines') %>
  - host: <%= machine %>:<%= p('cf.nats.port') %>
    user: <%= p('cf.nats.username') %>
    password: <%= p('cf.nats.password') %>
<% end %>
host: <%= ip %>
port: <%= p('redis.broker.nginx.port') %>
health_checker:
  name: redis-broker
  interval_in_seconds: 10

routes:
- name: "broker_<%= index %>"
  port: 80
  uris:
  - <%= p('redis.broker.subdomain') %>.<%= p('cf.apps_domain') %>
  registration_interval: 10
  health_check:
    name: redis-broker

Update config to newer route-registrar requirement
Update config to newer route-registrar requirement

[#127561353]

Signed-off-by: Jonathan Qiwen Tsang <3d227aa6bffde73f6e08f0ffd3491f423c329e82@pivotal.io>
