MySQL major version 8 was released on April 2018. I introduce how to write MySQL 8 ansible playbook. Motivation I usually use AWS. AWS has a database managed service called RDS, and RDS supports MySQL 5.x series. To conduct in-house training using MySQL 8, I needed to make AMI of MySQL 8 with ansible. Environment CentOS 7 Ansible 2.6.1 Packer 1.1.3 Configuration sample of ansible playbook In this case, I describe only the main task definition part in Ansible, I omit Packer configuration because it becomes redundant.