---
-
  name: Ensure MySQL Python libraries are installed.
  community.general.pacman:
    name: mysql-python
    state: present

-
  name: Ensure MySQL packages are installed.
  community.general.pacman:
    name: "{{ mysql_packages }}"
    state: present
  register: arch_mysql_install_packages

-
  name: Run mysql_install_db if MySQL packages were changed.
  ansible.builtin.command: mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
  when: arch_mysql_install_packages.changed
  tags: ['skip_ansible_lint']
