{% if datacenter == 'iad2' %}
{% if env == 'staging' %}
suffix  = 'stg.iad2.fedoraproject.org'
{% else %}
suffix = 'iad2.fedoraproject.org'
vpn_suffix = 'vpn.fedoraproject.org'
{% endif %}
{% else %}
{% if env == 'staging' %}
suffix  = 'stg.fedoraproject.org'
{% else %}
suffix = 'fedoraproject.org'
vpn_suffix = 'vpn.fedoraproject.org'
{% endif %}
{% endif %}

# This is just an extension of fedmsg.d/endpoints.py.  This dict
# will get merged in with the other.
config = dict(
    endpoints={
        # This is the output side of the relay to which all other
        # services can listen.
        "relay_outbound": [
            # Messages emerge here
            "tcp://busgateway01.%s:3999" % suffix,
        ],
    },
    # This is the address of an active->passive relay.  It is used for the
    # fedmsg-logger command which requires another service with a stable
    # listening address for it to send messages to.
    # It is also used by the git-hook, for the same reason.
    # It is also used by the mediawiki php plugin which, due to the oddities of
    # php, can't maintain a single passive-bind endpoint of it's own.
    relay_inbound=[

        # Primarily, scripts from inside iad2 connect here.
        # Furthermore, scripts from outside (coprs, secondary arch koji) connect
        # here via haproxy.
        "tcp://busgateway01.%s:9941" % suffix,

        # Scripts from the vpn (people03, anitya) connect here
        "tcp://busgateway01.vpn.fedoraproject.org:3998",

    ],
)
