forked from evolix/ansible-roles
Add filters and arbitrary options
(+ Make config file a bit more readable)
This commit is contained in:
parent
129a2b4da7
commit
e22703425d
|
@ -26,4 +26,23 @@ maxscale_services:
|
|||
- name: "Splitter"
|
||||
router: "readwritesplit"
|
||||
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'
|
||||
|
||||
|
|
|
@ -33,6 +33,14 @@ password={{ encrypt_maxscale_mysql_password_result['stdout'] }}
|
|||
{% else %}
|
||||
password = {{ encrypted_maxscale_mysql_password }}
|
||||
{% 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]
|
||||
type = listener
|
||||
|
@ -41,3 +49,12 @@ protocol=MariaDBClient
|
|||
port = {{ service['port'] }}
|
||||
{% endfor %}
|
||||
|
||||
{% for _filter in maxscale_filters %}
|
||||
[{{ _filter['name'] }}]
|
||||
type = filter
|
||||
module = {{ _filter['module'] }}
|
||||
{% for option in _filter['options'] %}
|
||||
{{ option['name'] }} = {{ option['value'] }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue