# Deploy the app

- name: make the app be real
  hosts: os-masters-stg[0]:os-masters[0]
  user: root
  gather_facts: False

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

  roles:
  - role: rabbit/user
    username: "anitya{{ env_suffix }}"
  - role: openshift/project
    app: release-monitoring
    description: release-monitoring
    appowners:
    - zlopez
  - role: openshift/secret-file
    app: release-monitoring
    secret_name: release-monitoring-fedora-messaging-ca
    key: fedora-messaging-release-monitoring-ca.crt
    privatefile: "rabbitmq/{{env}}/pki/ca.crt"
  - role: openshift/secret-file
    app: release-monitoring
    secret_name: release-monitoring-fedora-messaging-key
    key: fedora-messaging-release-monitoring.key
    privatefile: "rabbitmq/{{env}}/pki/private/anitya{{env_suffix}}.key"
  - role: openshift/secret-file
    app: release-monitoring
    secret_name: release-monitoring-fedora-messaging-cert
    key: fedora-messaging-release-monitoring.crt
    privatefile: "rabbitmq/{{env}}/pki/issued/anitya{{env_suffix}}.crt"
  - role: openshift/object
    app: release-monitoring
    file: imagestream.yml
    objectname: imagestream.yml
  - role: openshift/object
    app: release-monitoring
    template: buildconfig.yml
    objectname: buildconfig.yml
  - role: openshift/start-build
    app: release-monitoring
    buildname: release-monitoring-web-build
  - role: openshift/object
    app: release-monitoring
    template: configmap.yml
    objectname: configmap.yml
  - role: openshift/object
    app: release-monitoring
    file: service.yml
    objectname: service.yml
  - role: openshift/object
    app: release-monitoring
    template: route.yml
    objectname: route.yml
  - role: openshift/object
    app: release-monitoring
    file: deploymentconfig.yml
    objectname: deploymentconfig.yml
  - role: openshift/object
    app: release-monitoring
    file: cron.yml
    objectname: cron.yml
  - role: openshift/rollout
    app: release-monitoring
    dcname: release-monitoring-web
