diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 3cfe518..8b07af9 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -10,3 +10,13 @@ - name: Ensure MySQL packages are installed. apt: "name={{ item }} state=installed" with_items: mysql_packages + +# Because Ubuntu starts MySQL as part of the install process, we need to stop +# mysql and remove the logfiles in case the user set a custom log file size. +- name: Ensure MySQL is stopped after initial install. + service: name=mysql state=stopped + when: mysql_installed.stat.exists == false + +- name: Delete innodb log files created by apt package after initial install. + shell: "rm -f {{ mysql_datadir }}/ib_logfile[01]" + when: mysql_installed.stat.exists == false diff --git a/tests/test.yml b/tests/test.yml index 76c9bf7..bfe6c6c 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -1,8 +1,5 @@ --- - hosts: localhost remote_user: root - vars: - # Use default log file size so Travis CI VM allows MySQL restart. - - mysql_innodb_log_file_size: "5M" roles: - ansible-role-mysql