// the find
geerlingguy/ansible-role-mysql
Ansible Role - MySQL
A long-running Ansible role from Jeff Geerling that installs and configures MySQL or MariaDB on RHEL/CentOS, Debian/Ubuntu, and Arch. It's for anyone doing traditional server provisioning with Ansible who wants a battle-tested role instead of writing their own tasks for user/database/replication setup.
It's been maintained since 2014 and still gets pushes in 2026, with molecule tests, ansible-lint, and yamllint wired into CI across multiple OS targets. Replication is a first-class concept (server_id, replication_role, replication_user) rather than bolted on. The mysql_users/mysql_databases variable shapes map directly onto the community.mysql modules, so there's no bespoke abstraction to learn on top of what you already know from those modules.
The default root password is the string 'root' and mysql_root_password_update only fires on first run, so it's easy to end up with a permanently weak root password if you don't override it explicitly. mysql_hide_passwords defaults to false, meaning user/root passwords can land in plaintext in your Ansible log output unless you opt in to hiding them. overwrite_global_mycnf defaults to true, so any manual edits to my.cnf on the box get clobbered on the next run — fine if you know that, a nasty surprise if you don't. MariaDB support isn't automatic; you have to manually override mysql_packages and mysql_daemon per OS rather than the role detecting it for you.