mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-16 13:56:03 +08:00
110 lines
3.3 KiB
YAML
110 lines
3.3 KiB
YAML
- name: make the app be real
|
|
hosts: os-masters[0]:os-masters-stg[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
|
|
|
|
pre_tasks:
|
|
- include_vars: dir=/srv/web/infra/ansible/vars/all/ ignore_files=README
|
|
|
|
roles:
|
|
- role: openshift/project
|
|
app: bodhi
|
|
description: bodhi
|
|
appowners:
|
|
- bowlofeggs
|
|
- cverna
|
|
- abompard
|
|
tags:
|
|
- apply-appowners
|
|
- role: openshift/keytab
|
|
app: bodhi
|
|
key: koji-keytab
|
|
secret_name: bodhi-keytab
|
|
service: bodhi
|
|
host: "bodhi{{ env_suffix }}.fedoraproject.org"
|
|
# When we deploy Bodhi 4.0.0 to production, we can drop the env staging statements on the
|
|
# fedora-messaging items below.
|
|
- role: openshift/secret-file
|
|
app: bodhi
|
|
secret_name: bodhi-fedora-messaging-ca
|
|
key: cacert.pem
|
|
privatefile: "rabbitmq/{{env}}/pki/ca.crt"
|
|
when: env == "staging"
|
|
- role: openshift/secret-file
|
|
app: bodhi
|
|
secret_name: bodhi-fedora-messaging-crt
|
|
key: bodhi-cert.pem
|
|
privatefile: "rabbitmq/{{env}}/pki/issued/bodhi{{env_suffix}}.crt"
|
|
when: env == "staging"
|
|
- role: openshift/secret-file
|
|
app: bodhi
|
|
secret_name: bodhi-fedora-messaging-key
|
|
key: bodhi-key.pem
|
|
privatefile: "rabbitmq/{{env}}/pki/private/bodhi{{env_suffix}}.key"
|
|
when: env == "staging"
|
|
# When we deploy Bodhi 4.0.0 to production, we can drop these fedmsg secrets.
|
|
- role: openshift/secret-file
|
|
app: bodhi
|
|
secret_name: bodhi-fedmsg-key
|
|
key: fedmsg-bodhi.key
|
|
privatefile: fedmsg-certs/keys/bodhi-bodhi-web-temp-bodhi.app.os.fedoraproject.org.key
|
|
when: env != "staging"
|
|
- role: openshift/secret-file
|
|
app: bodhi
|
|
secret_name: bodhi-fedmsg-crt
|
|
key: fedmsg-bodhi.crt
|
|
privatefile: fedmsg-certs/keys/bodhi-bodhi-web-temp-bodhi.app.os.fedoraproject.org.crt
|
|
when: env != "staging"
|
|
- role: openshift/imagestream
|
|
app: bodhi
|
|
imagename: bodhi-web
|
|
- role: openshift/object
|
|
app: bodhi
|
|
template: buildconfig.yml
|
|
objectname: buildconfig.yml
|
|
bodhi_version: 4.0.0-0.1.beta.fc29.infra
|
|
when: env == "staging"
|
|
- role: openshift/object
|
|
app: bodhi
|
|
template: buildconfig.yml
|
|
objectname: buildconfig.yml
|
|
bodhi_version: 3.14.0-1.fc29.infra
|
|
when: env == "production"
|
|
- role: openshift/start-build
|
|
app: bodhi
|
|
buildname: bodhi-web
|
|
- role: openshift/object
|
|
app: bodhi
|
|
template_fullpath: "{{roles_path}}/bodhi2/base/templates/configmap.yml"
|
|
objectname: configmap.yml
|
|
- role: openshift/object
|
|
app: bodhi
|
|
file: service.yml
|
|
objectname: service.yml
|
|
- role: openshift/route
|
|
app: bodhi
|
|
routename: bodhi-web
|
|
host: "bodhi{{ env_suffix }}.fedoraproject.org"
|
|
serviceport: web
|
|
servicename: bodhi-web
|
|
- role: openshift/object
|
|
app: bodhi
|
|
template: deploymentconfig.yml
|
|
objectname: deploymentconfig.yml
|
|
- role: openshift/rollout
|
|
app: bodhi
|
|
dcname: bodhi-web
|
|
|
|
post_tasks:
|
|
- name: Scale up pods
|
|
command: oc -n bodhi scale dc/bodhi-web --replicas={{ hostvars[groups['bodhi2'][0]]['openshift_pods'] }}
|
|
when: env == "production"
|
|
- name: Scale up pods
|
|
command: oc -n bodhi scale dc/bodhi-web --replicas={{ hostvars[groups['bodhi2-stg'][0]]['openshift_pods'] }}
|
|
when: env == "staging"
|