Commit fb35ca36 authored by Benoît Knecht's avatar Benoît Knecht Committed by Guillaume Abrioux
Browse files

ceph-rgw-loadbalancer: Fix rgw_ports fact



The `set_fact rgw_ports` task was failing due to a templating error, because
`hostvars[item].rgw_instances` is a list, but it was treated as if it was a
dictionary.

Another issue was the fact that the `unique` filter only applied to the list
being appended to `rgw_ports` instead of the entire list, which means it was
possible to have duplicate items.

Lastly, `rgw_ports` would have been a list of integers, but the `seport` module
expects a list of strings.

This commit fixes all of the issues above, allowing the `ceph-rgw-loadbalancer`
role to work on systems with SELinux enabled.
Signed-off-by: default avatarBenoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit c0785134)
parent 4468bd91
......@@ -41,7 +41,7 @@
block:
- name: set_fact rgw_ports
set_fact:
rgw_ports: "{{ rgw_ports | default([]) + [hostvars[item]['rgw_instances']['radosgw_frontend_port']] | unique }}"
rgw_ports: "{{ rgw_ports | default([]) | union(hostvars[item]['rgw_instances'] | map(attribute='radosgw_frontend_port') | map('string') | list) }}"
with_items: "{{ groups.get(rgw_group_name, []) }}"
- name: add selinux rules
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment