summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorRalph Bean <rbean@redhat.com>2015-06-12 16:27:31 +0000
committerRalph Bean <rbean@redhat.com>2015-06-12 16:27:45 +0000
commit60dbdd00cffcfa3c19ec056f3e9e8eacf00fdbdb (patch)
tree917667921232aff9df74fb261704a90a8790f20b /roles
parent7acd9320253f77985b8a7179c607a9772c684462 (diff)
downloadansible-60dbdd00cffcfa3c19ec056f3e9e8eacf00fdbdb.tar.gz
ansible-60dbdd00cffcfa3c19ec056f3e9e8eacf00fdbdb.tar.xz
ansible-60dbdd00cffcfa3c19ec056f3e9e8eacf00fdbdb.zip
Try dynamically generating some fedmsg config from group/host vars in staging.
Diffstat (limited to 'roles')
-rw-r--r--roles/anitya/fedmsg/templates/base.py.j25
-rw-r--r--roles/fedmsg/base/templates/base.py.j26
-rw-r--r--roles/fedmsg/base/templates/policy.py.j211
-rw-r--r--roles/pagure/fedmsg/templates/base.py.j24
4 files changed, 16 insertions, 10 deletions
diff --git a/roles/anitya/fedmsg/templates/base.py.j2 b/roles/anitya/fedmsg/templates/base.py.j2
index 6aa831b3e..8a9bcee4c 100644
--- a/roles/anitya/fedmsg/templates/base.py.j2
+++ b/roles/anitya/fedmsg/templates/base.py.j2
@@ -1,7 +1,6 @@
config = dict(
- topic_prefix="org.release-monitoring",
-
- environment="prod",
+ topic_prefix="{{ fedmsg_prefix }}",
+ environment="{{ fedmsg_env }}",
# This used to be set to 1 for safety, but it turns out it was
# excessive. It is the number of seconds that fedmsg should sleep
diff --git a/roles/fedmsg/base/templates/base.py.j2 b/roles/fedmsg/base/templates/base.py.j2
index 8a4427a22..c04852b0d 100644
--- a/roles/fedmsg/base/templates/base.py.j2
+++ b/roles/fedmsg/base/templates/base.py.j2
@@ -1,11 +1,7 @@
config = dict(
# Set this to dev if you're hacking on fedmsg or an app locally.
# Set to stg or prod if running in the Fedora Infrastructure.
- {% if env == 'staging' %}
- environment="stg",
- {% else %}
- environment="prod",
- {% endif %}
+ environment="{{ fedmsg_env }}",
# Most hosts will be "false" here indicating that if they publish messages,
# they will passively bind to ports and have other consuming services
diff --git a/roles/fedmsg/base/templates/policy.py.j2 b/roles/fedmsg/base/templates/policy.py.j2
index 3e2212cde..85c0739cf 100644
--- a/roles/fedmsg/base/templates/policy.py.j2
+++ b/roles/fedmsg/base/templates/policy.py.j2
@@ -216,6 +216,17 @@ config = dict(
topic_prefix + "announce.announcement": [
"announce-lockbox01.phx2.fedoraproject.org",
],
+
+ {% if env == 'staging' %}
+ # ** policy dynamically generated from inventory vars
+ # See ansible/filter_plugins/fedmsg.py for this inversion filter.
+ {% for topic, certs in hostvars | invert_fedmsg_authz_policy %}
+ "{{topic}}": [
+ {% for cert in certs %}
+ "{{ cert }}",{% endfor %}
+ ],
+ {% endfor %}
+ {% endif %}
},
)
diff --git a/roles/pagure/fedmsg/templates/base.py.j2 b/roles/pagure/fedmsg/templates/base.py.j2
index 21c9c79dc..18b9e26af 100644
--- a/roles/pagure/fedmsg/templates/base.py.j2
+++ b/roles/pagure/fedmsg/templates/base.py.j2
@@ -1,11 +1,11 @@
config = dict(
- topic_prefix="io.pagure",
# Tell every call to `fedmsg.publish` to use the relay
active=True,
cert_prefix="pagure",
- environment="prod",
+ topic_prefix="{{ fedmsg_prefix }}",
+ environment="{{ fedmsg_env }}",
# This used to be set to 1 for safety, but it turns out it was
# excessive. It is the number of seconds that fedmsg should sleep