fix syntax error

This commit is contained in:
Mark O'Brien 2020-06-24 11:34:58 +01:00 committed by Pierre-Yves Chibon
parent 669ee2544c
commit ac169de518
6 changed files with 285 additions and 0 deletions

View file

@ -0,0 +1,75 @@
- 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: openshift/project
app: toddlers
description: Small fedora-messaging toddlers that keep running around
appowners:
- pingou
- abompard
- role: rabbit/user
username: "toddlers{{ env_suffix }}"
- role: rabbit/queue
username: toddlers{{ env_suffix }}
queue_name: toddlers{{ env_suffix }}
routing_keys:
- "org.centos.#.ci.dist-git-pr.test.error"
- "org.centos.#.ci.dist-git-pr.test.complete"
- "org.centos.#.ci.dist-git-pr.test.running"
- "org.fedoraproject.#.buildsys.build.state.change"
thresholds:
warning: 10
critical: 100
- role: openshift/object
app: toddlers
template: buildconfig.yml
objectname: buildconfig.yml
- role: openshift/secret-file
app: toddlers
secret_name: toddlers-fedora-messaging-key
key: toddlers.key
privatefile: "rabbitmq/{{env}}/pki/private/toddlers{{env_suffix}}.key"
- role: openshift/secret-file
app: toddlers
secret_name: toddlers-fedora-messaging-crt
key: toddlers.crt
privatefile: "rabbitmq/{{env}}/pki/issued/toddlers{{env_suffix}}.crt"
- role: openshift/secret-file
app: toddlers
secret_name: toddlers-fedora-messaging-ca
key: toddlers.ca
privatefile: "rabbitmq/{{env}}/pki/ca.crt"
- role: openshift/object
app: toddlers
template: deploymentconfig.yml
objectname: deploymentconfig.yml
- role: openshift/object
app: toddlers
template: secret.yml
objectname: secret.yml
- role: openshift/object
app: toddlers
template: imagestream.yml
objectname: imagestream.yml
- role: openshift/start-build
app: toddlers
buildname: toddlers-build
objectname: toddlers-build

View file

@ -0,0 +1,25 @@
apiVersion: v1
kind: BuildConfig
metadata:
name: toddlers-build
labels:
environment: "toddlers"
spec:
output:
to:
kind: ImageStreamTag
name: toddlers:latest
source:
type: Git
git:
uri: https://pagure.io/fedora-infra/toddlers.git
{% if env == 'staging' %}
ref: "staging"
{% else %}
ref: "production"
{% endif %}
strategy:
type: Docker
triggers:
- type: ConfigChange
- type: ImageChange

View file

@ -0,0 +1,62 @@
---
apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: toddlers
service: toddlers
name: toddlers
spec:
replicas: 1
selector:
app: toddlers
deploymentconfig: toddlers
strategy:
type: Recreate
template:
metadata:
labels:
app: toddlers
deploymentconfig: toddlers
spec:
containers:
- name: toddlers
image: toddlers:latest
resources: {}
volumeMounts:
- name: toddlers-secret-volume
mountPath: /etc/fedora-messaging
readOnly: true
- name: fedora-messaging-ca-volume
mountPath: /etc/pki/rabbitmq/ca
readOnly: true
- name: fedora-messaging-key-volume
mountPath: /etc/pki/rabbitmq/key
readOnly: true
- name: fedora-messaging-cert-volume
mountPath: /etc/pki/rabbitmq/cert
readOnly: true
volumes:
- name: toddlers-secret-volume
secret:
secretName: toddlers-secret
- name: fedora-messaging-ca-volume
secret:
secretName: toddlers-fedora-messaging-ca
- name: fedora-messaging-key-volume
secret:
secretName: toddlers-fedora-messaging-key
- name: fedora-messaging-cert-volume
secret:
secretName: toddlers-fedora-messaging-crt
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- toddlers
from:
kind: ImageStreamTag
name: toddlers:latest

View file

@ -0,0 +1,101 @@
# A sample configuration for fedora-messaging. This file is in the TOML format.
# For complete details on all configuration options, see the documentation.
# https://fedora-messaging.readthedocs.io/en/stable/configuration.html
# Broker address
amqp_url = "amqps://toddlers{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Fpubsub"
callback = "toddlers.runner:RunningToddler"
# The topic_prefix configuration value will add a prefix to the topics of every sent message.
# This is used for migrating from fedmsg, and should not be used afterwards.
{% if env == "staging" %}
topic_prefix = "org.fedoraproject.stg"
{% else %}
topic_prefix = "org.fedoraproject.prod"
{% endif %}
[tls]
ca_cert = "/etc/pki/rabbitmq/ca/toddlers.ca"
keyfile = "/etc/pki/rabbitmq/key/toddlers.key"
certfile = "/etc/pki/rabbitmq/cert/toddlers.crt"
[client_properties]
app = "toddlers"
app_url = "https://pagure.io/fedora-infra/toddlers"
[exchanges."amq.topic"]
type = "topic"
durable = true
auto_delete = false
arguments = {}
[queues.toddlers]
durable = true
auto_delete = false
exclusive = false
arguments = {}
[[bindings]]
queue = "toddlers"
exchange = "amq.topic"
routing_keys = ["#"] # This is dynamically generated in the code
[consumer_config]
# Comment out or remove this line if you want to enable the debug toddler.
# Or add more toddlers to the list (using their name) if you want to disable
# more of them.
blocked_toddlers = ["debug"]
[consumer_config.flag_ci_pr]
# flag_ci_pr
pagure_token_seed = "{{ }}"
pagure_token = "{{ }}"
pagure_url = "https://src.fedoraproject.org"
[consumer_config.flag_commit_build]
# flag_commit_build
pagure_token = "{{ }}"
pagure_url = "https://src.fedoraproject.org"
koji_url = "https://koji.fedoraproject.org"
[qos]
prefetch_size = 0
prefetch_count = 1
[log_config]
version = 1
disable_existing_loggers = true
[log_config.formatters.simple]
format = "[%(levelname)s %(name)s] %(message)s"
[log_config.handlers.console]
class = "logging.StreamHandler"
formatter = "simple"
stream = "ext://sys.stdout"
[log_config.loggers.fedora_messaging]
level = "INFO"
propagate = false
handlers = ["console"]
[log_config.loggers.twisted]
level = "INFO"
propagate = false
handlers = ["console"]
[log_config.loggers.pika]
level = "WARNING"
propagate = false
handlers = ["console"]
# Toddlers logger, feel free to bump the level to DEBUG if you need to
[log_config.loggers.toddlers]
level = "INFO"
propagate = false
handlers = ["console"]
[log_config.root]
level = "ERROR"
handlers = ["console"]

View file

@ -0,0 +1,10 @@
---
apiVersion: v1
kind: ImageStream
metadata:
name: toddlers
spec:
lookupPolicy:
local: false
status:
dockerImageRepository: ""

View file

@ -0,0 +1,12 @@
{% macro load_file(filename) %}{% include filename %}{%- endmacro -%}
---
apiVersion: v1
kind: secret
metadata:
name: toddlers-secret
labels:
app: toddlers
stringData:
config.toml: |-
{{ load_file('fedora-messaging.toml') | indent }}