ansible/roles/mysql/tasks/main.yml
2020-08-02 19:36:46 -05:00

26 lines
584 B
YAML

#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Set up MySQL
block:
- name: Install MySQL
apt:
name:
- mariadb-server
- python3-mysqldb
- name: Start MySQL
systemd:
name: mysql
enabled: yes
state: started
- name: Update root password
mysql_user:
name: root
host: localhost
password: "{{ mysql.root_password }}"
login_user: root
login_password: "{{ mysql.root_password }}"
check_implicit_admin: yes
priv: "*.*:ALL,GRANT"
become: yes