Everytime we run the playbook a new build kicks off, but the app was just restarted. So what happens is we end up with the app getting started twice (once when the deploymentconfig gets updated and once when the build finishes). This could be bad if the app has some startup steps that need to not be interrupted. Let's just manually trigger builds since we have the permissions to do that in the web interface and via the CLI.
103 lines
3.5 KiB
YAML
103 lines
3.5 KiB
YAML
- name: make the app be real
|
|
hosts: os_control:os_control_stg
|
|
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
|
|
|
|
vars:
|
|
- fedora_messaging_username: "coreos-ostree-importer{{ env_suffix }}"
|
|
- fedora_messaging_queue_name: "coreos-ostree-importer{{ env_suffix }}"
|
|
- fedora_messaging_ca_file: "coreos-ostree-importer-fedora-messaging-cacert.pem"
|
|
- fedora_messaging_cert_file: "coreos-ostree-importer-fedora-messaging-cert.pem"
|
|
- fedora_messaging_key_file: "coreos-ostree-importer-fedora-messaging-key.pem"
|
|
|
|
# Set the fedora_messaging_routing_keys var based on the environment
|
|
pre_tasks:
|
|
- set_fact:
|
|
fedora_messaging_routing_keys:
|
|
- "org.fedoraproject.stg.coreos.build.request.ostree-import"
|
|
when: env == 'staging'
|
|
- set_fact:
|
|
fedora_messaging_routing_keys:
|
|
- "org.fedoraproject.prod.coreos.build.request.ostree-import"
|
|
when: env != 'staging'
|
|
|
|
############################################
|
|
# actions to create the project in OpenShift
|
|
############################################
|
|
# to run: sudo rbac-playbook -l os_control_stg openshift-apps/coreos-ostree-importer.yml
|
|
roles:
|
|
- role: openshift/project
|
|
app: coreos-ostree-importer
|
|
description: Imports OSTree commits into Fedora from the Fedora CoreOS pipeline
|
|
appowners:
|
|
- dustymabe
|
|
- jlebon
|
|
- kevin
|
|
|
|
# Fedora Messaging User/Queue information
|
|
- role: rabbit/queue
|
|
username: "{{ fedora_messaging_username }}"
|
|
queue_name: "{{ fedora_messaging_queue_name }}"
|
|
routing_keys: "{{ fedora_messaging_routing_keys }}"
|
|
thresholds:
|
|
warning: 10
|
|
critical: 100
|
|
sent_topics: ^org\.fedoraproject\.{{ env_short }}\.coreos\..*
|
|
|
|
# Fedora Messaging secrets
|
|
- role: openshift/secret-file
|
|
app: coreos-ostree-importer
|
|
secret_name: fedora-messaging-ca
|
|
key: "{{ fedora_messaging_ca_file }}"
|
|
privatefile: "rabbitmq/{{env}}/pki/ca.crt"
|
|
- role: openshift/secret-file
|
|
app: coreos-ostree-importer
|
|
secret_name: fedora-messaging-crt
|
|
key: "{{ fedora_messaging_cert_file }}"
|
|
privatefile: "rabbitmq/{{env}}/pki/issued/coreos-ostree-importer{{env_suffix}}.crt"
|
|
- role: openshift/secret-file
|
|
app: coreos-ostree-importer
|
|
secret_name: fedora-messaging-key
|
|
key: "{{ fedora_messaging_key_file }}"
|
|
privatefile: "rabbitmq/{{env}}/pki/private/coreos-ostree-importer{{env_suffix}}.key"
|
|
|
|
# Fedora Messaging config
|
|
- role: openshift/object
|
|
app: coreos-ostree-importer
|
|
template: configmap.yml
|
|
objectname: configmap.yml
|
|
|
|
- role: openshift/object
|
|
app: coreos-ostree-importer
|
|
template: imagestream.yml
|
|
objectname: imagestream.yml
|
|
|
|
- role: openshift/object
|
|
app: coreos-ostree-importer
|
|
template: buildconfig.yml
|
|
objectname: buildconfig.yml
|
|
|
|
- role: openshift/object
|
|
app: coreos-ostree-importer
|
|
template: deploymentconfig.yml
|
|
objectname: deploymentconfig.yml
|
|
|
|
- role: openshift/object
|
|
app: coreos-ostree-importer
|
|
template: pvc.yml
|
|
objectname: pvc.yml
|
|
|
|
###############################################
|
|
# actions to delete the project from OpenShift
|
|
###############################################
|
|
# to run: sudo rbac-playbook -l os_control_stg -t delete openshift-apps/coreos-ostree-importer.yml
|
|
- role: openshift/object-delete
|
|
app: coreos-ostree-importer
|
|
objecttype: project
|
|
objectname: coreos-ostree-importer
|
|
tags: [ never, delete ]
|