summaryrefslogtreecommitdiffstats
path: root/roles/bodhi2/base/templates/fedora-messaging.toml.j2
blob: 9f6b83439b70cc4ba574eedee566c0eb5dc38859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
amqp_url = "amqps://bodhi{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Fpubsub"

{% if env == "staging" %}
topic_prefix = "org.fedoraproject.stg"
{% else %}
topic_prefix = "org.fedoraproject.prod"
{% endif %}

publish_exchange = "amq.topic"
passive_declares = true

{# If bodhi_message_routing_keys is defined, this must be a consumer so let's also set up the consumer
   config. #}
{% if bodhi_message_routing_keys is defined %}
callback = "bodhi.server.consumers:Consumer"
{# End consumer config if statement #}
{% endif %}


[tls]
ca_cert = "/etc/pki/fedora-messaging/cacert.pem"
keyfile = "/etc/pki/fedora-messaging/bodhi-key.pem"
certfile = "/etc/pki/fedora-messaging/bodhi-cert.pem"


[client_properties]
app = "bodhi"


{# If bodhi_message_routing_keys is defined, this must be a consumer so let's also set up the consumer
   config. #}
{% if bodhi_message_routing_keys is defined %}
[queues."{{ bodhi_message_queue_name }}"]
durable = true
auto_delete = false
exclusive = false
arguments = {}


[[bindings]]
queue = "{{ bodhi_message_queue_name }}"
exchange = "amq.topic"
routing_keys = [
{% for key in bodhi_message_routing_keys %}
    "{{ key }}",
{% endfor %}
]


[log_config]
version = 1
disable_existing_loggers = true


[log_config.filters.rate_limit]
"()" = "bodhi.server.logging.RateLimiter"
rate = 3600


[log_config.formatters.simple]
format = "%(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s"


[log_config.handlers.console]
class = "logging.StreamHandler"
formatter = "simple"
stream = "ext://sys.stdout"


[log_config.handlers.email]
class = "logging.handlers.SMTPHandler"
formatter = "simple"
level = "ERROR"
filters = ["rate_limit"]
mailhost = "bastion"
{% if env == "staging" %}
fromaddr = "updates@stg.fedoraproject.org"
{% else %}
fromaddr = "updates@fedoraproject.org"
{% endif %}
toaddrs = ["bodhiadmin-members@fedoraproject.org"]
subject = "Bodhi error"


[log_config.loggers.bodhi]
level = "INFO"
propagate = false
handlers = ["console", "email"]


[log_config.loggers.fedora_messaging]
level = "INFO"
propagate = false
handlers = ["console", "email"]


# Twisted is the asynchronous framework that manages the TCP/TLS connection, as well
# as the consumer event loop. When debugging you may want to lower this log level.
[log_config.loggers.twisted]
level = "INFO"
propagate = false
handlers = ["console", "email"]


# Pika is the underlying AMQP client library. When debugging you may want to
# lower this log level.
[log_config.loggers.pika]
level = "WARNING"
propagate = false
handlers = ["console"]


[log_config.root]
level = "ERROR"
handlers = ["console", "email"]
{# End consumer config if statement #}
{% endif %}