diff --git a/tasks/configure.yml b/tasks/configure.yml index 3c949ed..842a0e9 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -1,5 +1,9 @@ # file: mysql/tasks/configure.yml +- name: MySQL | Get version number + command: mysql --version | sed -e 's/.*Distrib \([0-9\.]*\).*/\1/' + register: mysql_version + - name: MySQL | Update the my.cnf template: src: etc_mysql_my.cnf.j2 diff --git a/templates/etc_mysql_my.cnf.j2 b/templates/etc_mysql_my.cnf.j2 index 1f61bf0..d00c7e6 100644 --- a/templates/etc_mysql_my.cnf.j2 +++ b/templates/etc_mysql_my.cnf.j2 @@ -33,7 +33,7 @@ thread_cache_size = {{ mysql_cache_size }} max_connections = {{ mysql_max_connections }} table_open_cache = {{ mysql_table_cache }} max_allowed_packet = {{ mysql_max_allowed_packet }} -{% if not '5.7' in mysql_ppa %} +{% if mysql_version | version_compare('5.7', '<=') %} # ** Not compatible with 5.7 key_buffer = {{ mysql_key_buffer }} myisam-recover = {{ mysql_myisam_recover }}