diff --git a/defaults/main.yml b/defaults/main.yml index 78fd71a..bdb456c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -66,10 +66,7 @@ mysql_extra_configuration: [] # Example: #mysql_extra_configuration: -# - group_name: 'mysqld' -# conf: -# - key: 'innodb_awsome_feature' -# value: 1 +# 'innodb_awsome_feature': 1 # ------------------------------------- diff --git a/templates/etc/mysql/conf.d/10-extra.cnf.j2 b/templates/etc/mysql/conf.d/10-extra.cnf.j2 index b37ab9e..adc6f96 100644 --- a/templates/etc/mysql/conf.d/10-extra.cnf.j2 +++ b/templates/etc/mysql/conf.d/10-extra.cnf.j2 @@ -2,16 +2,13 @@ # {{ ansible_managed }} # ------------------------------------------- -{% for i in mysql_extra_configuration %} -[{{ i.group_name }}] -{% for c in i.conf %} -{% if c.value is defined %} -{{ c.key }} = {{ c.value }} +[mysqld] +{% for key, value in mysql_extra_configuration.iteritems() %} +{% if value is defined or value is not none %} +{{ key }} = {{ value }} {% else %} -{{ c.key }} +{{ key }} {% endif %} {% endfor %} -{% endfor %} - ; vim: set ft=dosini : diff --git a/tests/group_vars/all b/tests/group_vars/all index be99ae6..fea23c6 100644 --- a/tests/group_vars/all +++ b/tests/group_vars/all @@ -1,2 +1,4 @@ mysql_use_percona_repository: true mysql_bind_address: '{{ ansible_eth1.ipv4.address }}' +mysql_extra_configuration: + innodb_commit_concurrency: 0