Add filters and arbitrary options
Some checks failed
continuous-integration/drone/pr Build is failing

(+ Make config file a bit more readable)
This commit is contained in:
Mathieu Trossevin 2020-06-29 10:04:48 +02:00
parent 129a2b4da7
commit e22703425d
2 changed files with 58 additions and 22 deletions

View file

@ -26,4 +26,23 @@ maxscale_services:
- name: "Splitter" - name: "Splitter"
router: "readwritesplit" router: "readwritesplit"
port: 3306 port: 3306
options: []
filters: []
# Full example:
# maxscale_services:
# - name: "ExampleServ"
# router: "readwritesplit"
# port: 3306
# filters:
# - 'ExampleFilter'
# options: []
maxscale_filters: []
# Example:
# maxscale_filters:
# - name: 'ExampleFilter'
# module: 'dbfwfilter'
# options:
# - name: 'rules'
# value: 'examplefilter.txt'

View file

@ -33,6 +33,14 @@ password={{ encrypt_maxscale_mysql_password_result['stdout'] }}
{% else %} {% else %}
password = {{ encrypted_maxscale_mysql_password }} password = {{ encrypted_maxscale_mysql_password }}
{% endif %} {% endif %}
{% if service['filters'] is defined and service['filters'] %}
filters = {% for _filter in service['filters'] %}{{ _filter }}{% if not loop.last %} | {% endif %}{% endfor %}
{% endif %}
{% if service['options'] is defined %}
{% for option in service['options'] %}
{{ option['name'] }} = {{ option['value'] }}
{% endfor %}
{% endif %}
[{{ service['name'] }}-Listener] [{{ service['name'] }}-Listener]
type = listener type = listener
@ -41,3 +49,12 @@ protocol=MariaDBClient
port = {{ service['port'] }} port = {{ service['port'] }}
{% endfor %} {% endfor %}
{% for _filter in maxscale_filters %}
[{{ _filter['name'] }}]
type = filter
module = {{ _filter['module'] }}
{% for option in _filter['options'] %}
{{ option['name'] }} = {{ option['value'] }}
{% endfor %}
{% endfor %}