fatal: [db01]: FAILED! => {"changed": false, "msg": "The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required."}

centos7.5 使用ansible中的role安装mariadb创建用户报错

错误:

[root@m01 roles]# ansible-playbook site.yml 
TASK [mysql : create databases] ********************************************************************
fatal: [db01]: FAILED! => {"changed": false, "msg": "The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required."}

错误原因:

没有安装MySQL-python

解决方法:

安装MySQL-python
- name: Installed Mariadb Server
  yum: name={{ packages }} state=present
  vars:
    packages:
      - mariadb
      - mariadb-server
      - MySQL-python
原文地址:https://www.cnblogs.com/lvhanzhi/p/10461943.html