---
- name: Set up those ProxyPassReverse statements.  Somebody get me a cup of coffee..
  hosts: proxies_stg:proxies
  user: root
  gather_facts: true

  vars_files:
    - /srv/web/infra/ansible/vars/global.yml
    - "/srv/private/ansible/vars.yml"
    - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  handlers:
  - import_tasks: "{{ handlers_path }}/restart_services.yml"

  vars:
  - varnish_url: http://localhost:6081

  pre_tasks:

  - name: Remove some crusty files from bygone eras
    ansible.builtin.file: dest=/etc/httpd/conf.d/{{item}} state=absent
    with_items:
    - meetbot.fedoraproject.org/reversepassproxy.conf
    - meetbot.fedoraproject.org/meetbot.conf
    - qa.fedoraproject.org/qa-landingpage.conf
    notify:
    - Reload proxyhttpd
    tags:
    - httpd
    - httpd/reverseproxy


  roles:

  - role: httpd/reverseproxy
    website: copr.fedoraproject.org
    destname: coprapi
    when: env != "staging"
    tags: copr

  - role: httpd/reverseproxy
    website: copr.fedoraproject.org
    destname: copr
    proxyurl: http://localhost:10070
    keephost: true
    when: env == "staging"
    tags: copr

  - role: httpd/reverseproxy
    website: nagios.fedoraproject.org
    destname: nagios
    remotepath: /
    proxyurl: http://noc01.{{ datacenter }}.fedoraproject.org
    tags: nagios

  - role: httpd/reverseproxy
    website: nagios-rdu3.fedoraproject.org
    destname: nagios-rdu3
    remotepath: /
    proxyurl: http://noc01.rdu3.fedoraproject.org

  - role: httpd/reverseproxy
    website: zabbix.fedoraproject.org
    destname: zabbix
    remotepath: /
    proxyurl: http://localhost:10068
    keephost: true
    header_scheme: true
    when: env == "production"
    tags: zabbix

  - role: httpd/reverseproxy
    website: zabbix.stg.fedoraproject.org
    destname: zabbix
    remotepath: /
    proxyurl: http://localhost:10068
    keephost: true
    header_scheme: true
    when: env == "staging"
    tags: zabbix

  - role: httpd/reverseproxy
    website: lists.fedoraproject.org
    destname: mailman3
    localpath: /
    remotepath: /
    header_scheme: true
    keephost: true
    proxyurl: "{{ varnish_url }}"
    tags: lists.fedoraproject.org

  - role: httpd/reverseproxy
    website: lists.fedorahosted.org
    destname: mailman3
    localpath: /
    remotepath: /
    header_scheme: true
    keephost: true
    proxyurl: "{{ varnish_url }}"

  - role: httpd/reverseproxy
    website: lists.pagure.io
    destname: mailman3
    localpath: /
    remotepath: /
    header_scheme: true
    keephost: true
    proxyurl: "{{ varnish_url }}"
    when: env == "production"

  # The place for the raw originals
  - role: httpd/reverseproxy
    website: meetbot-raw.fedoraproject.org
    destname: meetbot
    remotepath: /meetbot/
    # Talk directly to the app server, not haproxy
    proxyurl: http://value01
    when: env != "staging"
    tags: meetbot-raw

  # The place for the fancy mote view
  - role: httpd/reverseproxy
    website: meetbot.fedoraproject.org
    destname: mote
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: mote

  # The place for the raw originals
  - role: httpd/reverseproxy
    website: meetbot-raw.fedoraproject.org
    destname: meetbot
    remotepath: /meetbot/
    # Talk directly to the app server, not haproxy
    proxyurl: http://value01
    tags: meetbot-raw
    when: env == "staging"

  - role: httpd/reverseproxy
    website: apps.fedoraproject.org
    destname: fedora-notifications
    localpath: /notifications-old
    remotepath: /notifications-old
    header_scheme: true
    proxyurl: http://localhost:10036
    tags:
    - fmn

  - role: httpd/reverseproxy
    website: "notifications{{ env_suffix }}.fedoraproject.org"
    destname: fmn
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags:
    - fmn

  - role: httpd/reverseproxy
    website: ask.fedoraproject.org
    destname: askbot
    proxyurl: "{{ varnish_url }}"

  - role: httpd/reverseproxy
    website: "accounts{{ env_suffix }}.fedoraproject.org"
    destname: noggin
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags:
    - noggin

  - role: httpd/reverseproxy
    website: "fasjson{{ env_suffix }}.fedoraproject.org"
    destname: fasjson
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags:
    - fasjson

  - role: httpd/reverseproxy
    website: "id{{ env_suffix }}.fedoraproject.org"
    destname: id
    proxyurl: http://localhost:10020
    keephost: true
    header_scheme: true
    tags:
    - id.fedoraproject.org

  - role: httpd/reverseproxy
    website: "sso{{ env_suffix }}.fedoraproject.org"
    destname: id
    proxyurl: http://localhost:10020
    keephost: true
    tags:
    - sso.fedoraproject.org

  - role: httpd/reverseproxy
    website: "username.id{{ env_suffix }}.fedoraproject.org"
    destname: usernameid
    proxyurl: http://localhost:10020
    keephost: true
    tags:
    - id.fedoraproject.org

  - role: httpd/reverseproxy
    website: "id{{ env_suffix }}.fedoraproject.org"
    destname: 00-kdcproxy
    remotepath: /KdcProxy
    localpath: /KdcProxy
    proxyurl: http://localhost:10053
    tags:
    - id.fedoraproject.org

  - role: httpd/reverseproxy
    website: "id{{ env_suffix }}.fedoraproject.org"
    destname: 00-ipa
    remotepath: /ipa
    localpath: /ipa
    proxyurl: http://localhost:10061
    tags:
    - id.fedoraproject.org

  - role: httpd/reverseproxy
    website: apps.fedoraproject.org
    destname: datagrepper
    remotepath: /datagrepper
    localpath: /datagrepper
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags:
    - datagrepper

  - role: httpd/reverseproxy
    website: "badges.fedoraproject.org"
    destname: badges
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags:
    - badges

  - role: httpd/reverseproxy
    website: kerneltest.fedoraproject.org
    destname: kerneltest
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    header_scheme: true
    tags: kerneltest

  - role: httpd/reverseproxy
    website: qa.fedoraproject.org
    destname: blockerbugs
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: true
    remotepath: /blockerbugs
    localpath: /blockerbugs
    tags: blockerbugs

  - role: httpd/reverseproxy
    website: fedoraproject.org
    destname: fp-wiki
    wpath: /w
    wikipath: /wiki
    proxyurl: "{{ varnish_url }}"

  - role: httpd/reverseproxy
    website: bodhi.fedoraproject.org
    destname: bodhi
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags: bodhi

#
# fedora core os routes
# These point to openshift
#
  - role: httpd/reverseproxy
    website: "updates.coreos{{ env_suffix }}.fedoraproject.org"
    destname: cincinnati
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    ocp4: true
    targettype: openshift
    keephost: true
    tags:
    - updates.coreos.fedoraproject.org
    when: env != "staging"

  - role: httpd/reverseproxy
    website: "status.updates.coreos{{ env_suffix }}.fedoraproject.org"
    destname: cincinnati
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    ocp4: true
    targettype: openshift
    keephost: true
    tags:
    - updates.coreos.fedoraproject.org
    when: env != "staging"

  - role: httpd/reverseproxy
    website: "raw-updates.coreos{{ env_suffix }}.fedoraproject.org"
    destname: cincinnati
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    ocp4: true
    targettype: openshift
    keephost: true
    tags:
    - updates.coreos.fedoraproject.org
    when: env != "staging"

  - role: httpd/reverseproxy
    website: "status.raw-updates.coreos{{ env_suffix }}.fedoraproject.org"
    destname: cincinnati
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    ocp4: true
    targettype: openshift
    keephost: true
    tags:
    - updates.coreos.fedoraproject.org
    when: env != "staging"

  - role: httpd/reverseproxy
    website: "updates.coreos{{ env_suffix }}.fedoraproject.org"
    destname: cincinnati
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    ocp4: true
    targettype: openshift
    keephost: true
    tags:
    - updates.coreos.fedoraproject.org
    when: env == "staging"

  - role: httpd/reverseproxy
    website: "status.updates.coreos{{ env_suffix }}.fedoraproject.org"
    destname: cincinnati
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    ocp4: true
    targettype: openshift
    keephost: true
    tags:
    - updates.coreos.fedoraproject.org
    when: env == "staging"

  - role: httpd/reverseproxy
    website: "raw-updates.coreos{{ env_suffix }}.fedoraproject.org"
    destname: cincinnati
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    ocp4: true
    targettype: openshift
    keephost: true
    tags:
    - updates.coreos.fedoraproject.org
    when: env == "staging"

  - role: httpd/reverseproxy
    website: "status.raw-updates.coreos{{ env_suffix }}.fedoraproject.org"
    destname: cincinnati
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    ocp4: true
    targettype: openshift
    keephost: true
    tags:
    - updates.coreos.fedoraproject.org
    when: env == "staging"


#
# end coreos
#

  - role: httpd/reverseproxy
    website: transtats.fedoraproject.org
    destname: transtats
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: transtats

  - role: httpd/reverseproxy
    website: "mirrormanager{{ env_suffix }}.fedoraproject.org"
    destname: mirrormanager
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags:
    - mirrormanager

  - role: httpd/reverseproxy
    website: admin.fedoraproject.org
    destname: mirrormanager-old
    remotepath: /mirrormanager
    localpath: /mirrormanager
    proxyurl: "{{ varnish_url }}"
    tags:
    - mirrormanager

  - role: httpd/reverseproxy
    website: mirrors.fedoraproject.org
    destname: mirrormanager-mirrorlist
    proxyurl: http://localhost:10002

  - role: httpd/reverseproxy
    website: mirrors.centos.org
    destname: mirrormanager-mirrorlist
    proxyurl: http://localhost:10002
    tags: mirrors.centos.org
    when: env != "staging"

  - role: httpd/reverseproxy
    website: mirrors.stg.centos.org
    destname: mirrormanager-mirrorlist
    proxyurl: http://localhost:10002
    tags: mirrors.stg.centos.org
    when: env == "staging"

  - role: httpd/reverseproxy
    website: download.fedoraproject.org
    destname: mirrormanager-redirector
    proxyurl: http://localhost:10002

  - role: httpd/reverseproxy
    website: koschei.fedoraproject.org
    destname: koschei
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: koschei

  - role: httpd/reverseproxy
    website: openqa.fedoraproject.org
    destname: openqa
    balancer_name: openqa
    balancer_members: ['openqa01:80']
    http_not_https_yes_this_is_insecure_and_i_feel_bad: true
    when: env == "production"
    tags: openqa

  - role: httpd/reverseproxy
    website: openqa.fedoraproject.org
    destname: openqa
    balancer_name: openqa-stg
    balancer_members: ['openqa-lab01.rdu3.fedoraproject.org:80']
    http_not_https_yes_this_is_insecure_and_i_feel_bad: true
    when: env == "staging"
    tags: openqa-stg

  - role: httpd/reverseproxy
    website: admin.fedoraproject.org
    destname: yk-val
    remotepath: /yk-val/verify
    localpath: /yk-val/verify
    proxyurl: http://localhost:10004

  - role: httpd/reverseproxy
    website: admin.fedoraproject.org
    destname: pager
    remotepath: /pager
    localpath: /pager
    # Talk directly to the app server, not haproxy
    proxyurl: http://sundries01

  - role: httpd/reverseproxy
    website: admin.fedoraproject.org
    destname: awstats
    remotepath: /awstats
    localpath: /awstats
    # Talk directly to the app server, not haproxy
    proxyurl: http://log01

  - role: httpd/reverseproxy
    website: admin.fedoraproject.org
    destname: maps
    remotepath: /maps
    localpath: /maps
    # Talk directly to the app server, not haproxy
    proxyurl: http://log01

  - role: httpd/reverseproxy
    website: fedoraproject.org
    destname: freemedia
    remotepath: /freemedia
    localpath: /freemedia
    proxyurl: http://localhost:10011

  - role: httpd/reverseproxy
    website: admin.fedoraproject.org
    destname: collectd
    localpath: /collectd
    remotepath: /collectd
    # Talk directly to the app server, not haproxy
    proxyurl: http://log01
    tags: data-analysis

  - role: httpd/reverseproxy
    website: data-analysis.fedoraproject.org
    destname: data-analysis
    remotepath: /
    localpath: /
    proxyurl: http://log01
    tags: data-analysis

  ### staging entries for resultsdb and resultsdb_frontend
  - role: httpd/reverseproxy
    website: resultsdb.stg.fedoraproject.org
    destname: zz-resultsdb-resultsdb
    localpath: /
    remotepath: /
    balancer_name: resultsdb-stg
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    when: env == "staging"
    tags: resultsdb

  ### production entries for resultsdb and resultsdb_frontend
  - role: httpd/reverseproxy
    website: resultsdb.fedoraproject.org
    destname: zz-resultsdb-resultsdb
    localpath: /
    remotepath: /
    balancer_name: resultsdb
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    when: env != "staging"
    tags: resultsdb

  # This one gets its own role (instead of httpd/reverseproxy) so that it can
  # copy in some silly static resources (globe.png, index.html)
  - role: geoip-city-wsgi/proxy
    website: geoip.fedoraproject.org
    proxyurl: http://localhost:10029

  - role: httpd/reverseproxy
    website: src.fedoraproject.org
    destname: git
    proxyurl: "{{ varnish_url }}"
    header_scheme: true
    keephost: true
    when: env == "staging"
    tags:
    - src.fedoraproject.org

  - role: httpd/reverseproxy
    website: src.fedoraproject.org
    destname: git
    #proxyurl: http://localhost:10057
    proxyurl: "{{ varnish_url }}"
    header_scheme: true
    keephost: true
    when: env != "staging"
    tags:
    - src.fedoraproject.org

  - role: httpd/reverseproxy
    website: registry.fedoraproject.org
    destname: registry-fedora
    # proxyurl in this one is totally ignored, because Docker.
    # (turns out it uses PATCH requests that Varnish cannot deal with)
    proxyurl: "{{ varnish_url }}"
    tags:
    - registry

  - role: httpd/reverseproxy
    website: candidate-registry.fedoraproject.org
    destname: candidate-registry
    proxyurl: http://localhost:10054

  - role: httpd/reverseproxy
    website: retrace.fedoraproject.org
    destname: retrace
    proxyurl: http://localhost:10049
    when: env == "staging"

  - role: httpd/reverseproxy
    website: faf.fedoraproject.org
    destname: faf
    proxyurl: http://localhost:10050
    when: env == "staging"

  - role: httpd/reverseproxy
    website: apps.fedoraproject.org
    destname: pps
    remotepath: /pps
    localpath: /pps
    proxyurl: http://localhost:10051
    when: env == "staging"

  - role: httpd/reverseproxy
    website: koji.fedoraproject.org
    destname: koji
    keephost: true
    balancer_name: koji
    balancer_members:
    - "koji01.{{ datacenter }}.fedoraproject.org"
    - "koji02.{{ datacenter }}.fedoraproject.org"
    http_not_https_yes_this_is_insecure_and_i_feel_bad: true
    tags:
    - koji-prod
    when: env == "production"

  - role: httpd/reverseproxy
    website: koji.fedoraproject.org
    destname: koji
    keephost: true
    balancer_name: koji
    balancer_members:
    - "koji01.stg.{{ datacenter }}.fedoraproject.org"
    http_not_https_yes_this_is_insecure_and_i_feel_bad: true
    tags:
    - koji-stg
    when: env == "staging"

  - role: httpd/reverseproxy
    website: riscv-koji.fedoraproject.org
    destname: koji
    keephost: true
    ocp4: false
    balancer_name: riscv-koji
    balancer_members:
    - "riscv-koji01.{{ datacenter }}.fedoraproject.org"
    http_not_https_yes_this_is_insecure_and_i_feel_bad: true
    tags:
    - riscv-koji

  - role: httpd/reverseproxy
    website: riscv-kojipkgs.fedoraproject.org
    destname: riscv-kojipkgs
    keephost: true
    balancer_name: riscv-kojipkgs
    ocp4: false
    balancer_members:
    - "riscv-koji01.{{ datacenter }}.fedoraproject.org"
    http_not_https_yes_this_is_insecure_and_i_feel_bad: true
    tags:
    - riscv-koji

  - role: httpd/reverseproxy
    website: kojipkgs.fedoraproject.org
    destname: kojipkgs
    proxyurl: http://localhost:10062
    keephost: true
    tags:
    - kojipkgs-proxy

  - role: httpd/reverseproxy
    website: "ocp{{ env_suffix }}.fedoraproject.org"
    destname: ocp
    balancer_name: ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes_rdu3) }}"
    targettype: openshift
    ocp4: false
    ocp4_rdu3: true
    keephost: true
    tags:
    - ocp.stg.fedoraproject.org
    when: env == "staging"

  - role: httpd/reverseproxy
    website: "apps.ocp{{ env_suffix }}.fedoraproject.org"
    destname: apps.ocp
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes_rdu3) }}"
    targettype: openshift
    ocp4: false
    ocp4_rdu3: true
    keephost: true
    tags:
    - apps.ocp.stg.fedoraproject.org
    when: env == "staging"

  - role: httpd/reverseproxy
    website: "ocp{{ env_suffix }}.fedoraproject.org"
    destname: ocp
    balancer_name: ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags:
    - ocp.fedoraproject.org

  - role: httpd/reverseproxy
    website: "apps.ocp{{ env_suffix }}.fedoraproject.org"
    destname: apps.ocp
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags:
    - apps.ocp.fedoraproject.org

  - role: httpd/reverseproxy
    website: "ocp-rdu3{{ env_suffix }}.fedoraproject.org"
    destname: ocp-rdu3
    balancer_name: ocp-rdu3
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes_rdu3) }}"
    targettype: openshift
    ocp4_rdu3: true
    ocp4: false
    keephost: true
    tags:
    - ocp-rdu3.fedoraproject.org

  - role: httpd/reverseproxy
    website: "apps.ocp-rdu3{{ env_suffix }}.fedoraproject.org"
    destname: apps-ocp-rdu3
    balancer_name: apps-ocp-rdu3
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes_rdu3) }}"
    targettype: openshift
    ocp4_rdu3: true
    ocp4: false
    keephost: true
    tags:
    - apps.ocp-rdu3.fedoraproject.org

  - role: httpd/reverseproxy
    website: greenwave.fedoraproject.org
    destname: greenwave
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: greenwave

  - role: httpd/reverseproxy
    website: waiverdb.fedoraproject.org
    destname: waiverdb
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: waiverdb

  - role: httpd/reverseproxy
    website: elections.fedoraproject.org
    destname: elections
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: elections
    header_scheme: true

  - role: httpd/reverseproxy
    website: calendar.fedoraproject.org
    destname: calendar
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    header_scheme: true
    tags: calendar

  - role: httpd/reverseproxy
    website: mdapi.fedoraproject.org
    destname: mdapi
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: mdapi

  - role: httpd/reverseproxy
    website: release-monitoring.org
    destname: release-monitoring
    balancer_name: apps-ocp
    balancer_members: "{{ocp_nodes}}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: release-montoring.org
    when: env == "production"

  - role: httpd/reverseproxy
    website: stg.release-monitoring.org
    destname: stg.release-monitoring
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: release-montoring.org
    when: env == "staging"

  - role: httpd/reverseproxy
    website: whatcanidoforfedora.org
    destname: whatcanidoforfedora
    balancer_name: app-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: whatcanidoforfedora.org

  - role: httpd/reverseproxy
    website: testdays.fedoraproject.org
    destname: testdays
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: testdays

  - role: httpd/reverseproxy
    website: packager-dashboard.fedoraproject.org
    destname: packager-dashboard
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: packager-dashboard

  - role: httpd/reverseproxy
    website: debuginfod.fedoraproject.org
    destname: debuginfod
    # manage non-trivial reverse-proxy specs in template
    proxyurl: http://debuginfod01:8002
    proxyopts: "connectiontimeout=600 timeout=600 keepalive=on nocanon"
    tags:
    - debuginfod

  - role: httpd/reverseproxy
    website: packages.fedoraproject.org
    destname: fedora-packages-static
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags:
    - fedora-packages-static

  - role: httpd/reverseproxy
    website: "discourse2fedmsg{{ env_suffix }}.fedoraproject.org"
    destname: discourse2fedmsg
    balancer_name: app-os
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags: discourse2fedmsg

#  - role: httpd/reverseproxy
#    website: ipsilon-project.org
#    destname: ipsilon-website
#    balancer_name: apps-ocp
#    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
#    targettype: openshift
#    ocp4: "{{ (env == 'production') | bool }}"
#    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
#    # When prod has moved to rdu3:
#    #ocp4: false
#    #ocp4_rdu3: true
#    keephost: true
#    tags: ipsilon-website

  - role: httpd/reverseproxy
    website: awx.fedoraproject.org
    destname: awx
    balancer_name: app-ocp
    balancer_members: "{{ ocp_nodes }}"
    targettype: openshift
    ocp4: true
    keephost: true
    tags:
    - awx
    when: env == "production"

  - role: httpd/reverseproxy
    website: "openscanhub{{ env_suffix }}.fedoraproject.org"
    destname: openscanhub
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: true
    tags: openscanhub

  - role: httpd/reverseproxy
    website: "kanban.qa{{ env_suffix }}.fedoraproject.org"
    destname: kanban
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: true
    tags:
    - kanban

  - role: httpd/reverseproxy
    website: "fedoraplanet.org"
    destname: fedoraplanet
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags:
    - fedoraplanet

  - role: httpd/reverseproxy
    website: "webhook{{ env_suffix }}.fedoraproject.org"
    destname: webhook2fedmsg
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags:
    - webhook2fedmsg

  - role: httpd/reverseproxy
    website: "forge{{ env_suffix }}.fedoraproject.org"
    destname: forge
    balancer_name: apps-ocp
    balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
    targettype: openshift
    keephost: true
    ocp4: "{{ (env == 'production') | bool }}"
    ocp4_rdu3: "{{ (env == 'staging') | bool }}"
    # When prod has moved to rdu3:
    #ocp4: false
    #ocp4_rdu3: true
    tags:
    - forge
