---
- name: make the app be real
  hosts: os_control[0]:os_control_stg[0]
  user: root
  gather_facts: false
  vars:
    ssh_key_path: "{{ private }}/files/websites/id_rsa_web_trans_{{ env_short }}"
  vars_files:
    - /srv/web/infra/ansible/vars/global.yml
    - "/srv/private/ansible/vars.yml"
    - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  roles:
  - role: openshift/project
    app: websites
    description: Fedora websites building
    alerting: true
    appowners:
    - ryanlerch
    - darknao
    - kevin

  # legacy websites
  - role: openshift/object
    app: websites
    file: pvc.yml
    objectname: pvc.yml

  - role: openshift/imagestream
    app: websites
    imagename: fedora-websites

  - role: openshift/object
    app: websites
    template: fedora-websites-bc.yml
    objectname: fedora-websites-bc.yml

  - role: openshift/start-build
    app: websites
    buildname: fedora-websites
    objectname: fedora-websites

  - role: openshift/object
    app: websites
    template: fedora-websites-cron.yml
    objectname: fedora-websites-cron.yml

  # New websites 3.0
  - role: openshift/imagestream
    app: websites
    imagename: builder

  - role: openshift/object
    app: websites
    template: buildconfig.yml
    objectname: buildconfig.yml

  - role: openshift/start-build
    app: websites
    buildname: websites-build
    objectname: websites-build

  - role: openshift/object
    app: websites
    file: obc.yml
    objectname: obc.yml

  - role: openshift/object
    app: websites
    template: deployment.yml
    objectname: deployment.yml
