Fixes #60: Better detection of whether MySQL was installed.

pull/63/head
Jeff Geerling 9 years ago
parent fc6609cd67
commit 9e5e424d6c
  1. 2
      tasks/secure-installation.yml
  2. 1
      tasks/setup-Debian.yml
  3. 1
      tasks/setup-RedHat.yml

@ -11,7 +11,7 @@
mysql -u root -NBe
'SET PASSWORD FOR "{{ mysql_root_username }}"@"{{ item }}" = PASSWORD("{{ mysql_root_password }}");'
with_items: mysql_root_hosts.stdout_lines
when: mysql_service_configuration.changed or mysql_root_password_update
when: mysql_install_packages.changed or mysql_root_password_update
# Has to be after the root password assignment, for idempotency.
- name: Copy .my.cnf file with root password credentials.

@ -13,6 +13,7 @@
- name: Ensure MySQL packages are installed.
apt: "name={{ item }} state=installed"
with_items: mysql_packages
register: mysql_install_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.

@ -5,3 +5,4 @@
- name: Ensure MySQL packages are installed.
yum: "name={{ item }} state=installed enablerepo={{ mysql_enablerepo }}"
with_items: mysql_packages
register: mysql_install_packages