Here's a play I use to secure the default MySQL install as per the MySQL documentation - name: MySQL setup hosts: dbservers gather_facts: true tasks: - name: ensure mysql is running and starts on boot service: name=mysql state=started enabled=true # Need to do this for idempotency, see # http://ansible.cc/docs/modules.html#mysql-user - name: update mysql root password for all root accounts mysql_u
