Try passing in the list of hosts a different way.

This commit is contained in:
Ralph Bean 2015-06-12 16:42:46 +00:00
parent 7683da988a
commit 271300e94c
2 changed files with 3 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import operator
def invert_fedmsg_authz_policy(vars):
def invert_fedmsg_policy(hosts, vars):
""" Given hostvars that map hosts -> topics, invert that
and return a dict that maps topics -> hosts.
@ -28,5 +28,5 @@ def invert_fedmsg_authz_policy(vars):
class FilterModule(object):
def filters(self):
return {
"invert_fedmsg_authz_policy": invert_fedmsg_authz_policy,
"invert_fedmsg_policy": invert_fedmsg_policy,
}

View file

@ -220,7 +220,7 @@ config = dict(
{% 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 %}
{% for topic, certs in groups['all'] | invert_fedmsg_policy(hostvars) %}
"{{topic}}": [
{% for cert in certs %}
"{{ cert }}",{% endfor %}