Closed jasperla closed 7 years ago
hi. If I understood correctly then you need.
The parentheses that are obtained are predefined in the file https://github.com/le9i0nx/ansible-rspamd/blob/master/templates/etc/rspamd/conf.d/default.conf.j2#L5
You need to create a new file with an arbitrary name in the folder templates/etc/rspamd/conf.d
With something like this
#{{ ansible_managed }}
{% if item.data is mapping %}
{% for key, value in item.data|dictsort %}
{% set tabs = [] %}
{% for i in tabs %}{{i}}{% endfor %}{{ key }} = [
{% include 'nested_structure.j2' %}
{% for i in tabs %}{{i}}{% endfor %}]
{% endfor %}
{% endif %}
and
rspamd__conf_d:
- name: "redirector_domains"
type: "arbitrary name"
data:
redirector_domains:
raw:
- "${CONFDIR}/redirectors.inc:REDIRECTOR_FALSE"
- "$LOCAL_CONFDIR/local.d/redirectors.inc:LOCAL_REDIRECTOR_FALSE"
https://github.com/le9i0nx/ansible-rspamd/blob/master/tasks/config.yml#L15
It is possible so still
rspamd__conf_d:
- name: "redirector_domains"
data:
phishing:
raw:
- 'redirector_domains = ['
- ' "${CONFDIR}/redirectors.inc:REDIRECTOR_FALSE",'
- ' "$LOCAL_CONFDIR/local.d/redirectors.inc:LOCAL_REDIRECTOR_FALSE"'
- '];'
Thanks! This did the trick for me:
- name: phishing
data:
phising:
symbol: PHISHING
openphish_enabled: yes
raw:
- 'redirector_domains = ['
- ' "${CONFDIR}/redirectors.inc:REDIRECTOR_FALSE"'
- ' "$LOCAL_CONFDIR/local.d/redirectors.inc:LOCAL_REDIRECTOR_FALSE"'
- '];'
Hi,
I was wondering how one would define a structure that would end up as an array in the configuration file? Say the result should be:
I tried this:
but that results in:
Which doesn't seem to be equivalent.