summaryrefslogtreecommitdiff
path: root/roles/mysql/tasks/main.yml
blob: d261470a70a6418b5a8cbbba9b9cc003095452c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
- name: prepare package provider
  when: mysql_pkg_provider != 'distro'
  include_role:
    name: "apt-repo/{{ mysql_pkg_provider }}"

- name: install mysql packages
  apt:
    name:
    - "{{ mysql_pkg_name }}"
    - "{{ python_basename }}-pymysql"
    state: present

- name: delete anonymous MySQL server user
  mysql_user:
    login_unix_socket: /var/run/mysqld/mysqld.sock
    check_implicit_admin: yes
    user: ""
    state: absent
  no_log: true

- name: remove the MySQL test database
  mysql_db:
    login_unix_socket: /var/run/mysqld/mysqld.sock
    check_implicit_admin: yes
    db: test
    state: absent