---

- block:
  - name: "Create {{ mysql_custom_tmpdir }}"
    file:
      path: "{{ mysql_custom_tmpdir }}"
      owner: mysql
      group: mysql
      mode: "0700"
      state: directory
    tags:
      - mysql

  - name: Configure tmpdir
    ini_file:
      dest: "{{ mysql_config_directory }}/{{ mysql_evolinux_custom_file }}"
      section: mysqld
      option: tmpdir
      value: "{{ mysql_custom_tmpdir }}"
    notify: "{{ mysql_restart_handler_name }}"
    tags:
      - mysql
  when: mysql_custom_tmpdir | length > 0
