From a0731e22383142bc745659409dcd108ebbe073e7 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 28 Apr 2015 13:19:38 +0000 Subject: [PATCH] Make a way to configure the fedmsg "active" flag. --- inventory/group_vars/all | 4 ++++ inventory/group_vars/retrace | 4 ++++ roles/fedmsg/base/templates/base.py.j2 | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/inventory/group_vars/all b/inventory/group_vars/all index 39c3ecf078..a0e261f3b1 100644 --- a/inventory/group_vars/all +++ b/inventory/group_vars/all @@ -55,6 +55,10 @@ fedmsg_certs: [] # By default, fedmsg should not log debug info. Groups can override this. fedmsg_loglevel: INFO +# By default, fedmsg hosts are in passive mode. External hosts are typically +# active. +fedmsg_active: False + # By default, nodes don't backup any dbs on them unless they declare it. dbs_to_backup: [] diff --git a/inventory/group_vars/retrace b/inventory/group_vars/retrace index 778eebcd12..c27a581b5a 100644 --- a/inventory/group_vars/retrace +++ b/inventory/group_vars/retrace @@ -12,6 +12,10 @@ custom_rules: [ '-A INPUT -p tcp -m tcp -s 10.5.78.11 --dport 2049 -j ACCEPT', nrpe_procs_warn: 900 nrpe_procs_crit: 1000 +# Since retrace is on the qa network, it needs to actively connect to our +# inbound relay. +fedmsg_active: True + # Declare fedmsg certs that should be put in /etc/pki/fedmsg/ # These are consumed by a task in roles/fedmsg/base/main.yml fedmsg_certs: diff --git a/roles/fedmsg/base/templates/base.py.j2 b/roles/fedmsg/base/templates/base.py.j2 index 28575c8c1a..20487a9f6d 100644 --- a/roles/fedmsg/base/templates/base.py.j2 +++ b/roles/fedmsg/base/templates/base.py.j2 @@ -7,6 +7,13 @@ config = dict( environment="prod", {% endif %} + # Most hosts will be "false" here indicating that if they publish messages, + # they will passively bind to ports and have other consuming services + # actively connect to them. If this flag is set to True, then the service + # will actively connect out to a fedmsg-relay to have its messages forwarded + # on. + active={{fedmsg_active}}, + {% if not ansible_hostname.startswith('busgateway') %} # These options provide a place for hub processes to write out their last # processed message. This let's them read it in at startup and figure out