Merge pull request #140 from Routhinator/initialize_57_before_start

Adjust check to mysql.version due to compile fail on Arch.
This commit is contained in:
Forrest 2016-09-15 22:40:04 -07:00 committed by GitHub
commit 3b228c7276

View file

@ -64,7 +64,7 @@ mysql_delete_anonymous_user_{{ host }}:
# on arch linux: inital mysql datadirectory is not created
mysql_install_datadir:
cmd.run:
{% if pkg.version >= 5.7 %}
{% if mysql.version >= 5.7 %}
- name: mysqld --initialize-insecure --user=mysql --basedir=/usr --datadir=/var/lib/mysql
{% else %}
- name: mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
@ -88,7 +88,7 @@ mysqld-packages:
- debconf: mysql_debconf
{% endif %}
{% if os_family == 'RedHat' or 'Suse' and pkg.version >= 5.7 %}
{% if os_family == 'RedHat' or 'Suse' and mysql.version >= 5.7 %}
# Initialize mysql database with --initialize-insecure option before starting service so we don't get locked out.
mysql_initialize:
cmd.run:
@ -105,7 +105,7 @@ mysqld:
- enable: True
- require:
- pkg: {{ mysql.server }}
{% if os_family == 'RedHat' or 'Suse' and pkg.version >= 5.7 %}
{% if os_family == 'RedHat' or 'Suse' and mysql.version >= 5.7 %}
- cmd: mysql_initialize
{% endif %}
- watch: