I'm able to install few python modules on my app servers using ansible. But, when I include python-mysqldb module, it throws the below error.
vagrant@control:~/ansible$ ansible-playbook playbooks/webserver.yml
PLAY [webserver] ***************************************************************
TASK [setup] *******************************************************************
ok: [app02]
ok: [app01]
TASK [install web components] **************************************************
failed: [app02] (item=[u'apache2', u'libapache2-mod-wsgi', u'python-pip', u'python-virtualenv', u'python-mysqldb']) => {"failed": true, "item": ["apache2", "libapache2-mod-wsgi", "python-pip", "python-virtualenv", "python-mysqldb"], "module_stderr": "Shared connection to app02 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_sYzNC_/ansible_module_apt.py\", line 909, in <module>\r\n    main()\r\n  File \"/tmp/ansible_sYzNC_/ansible_module_apt.py\", line 892, in main\r\n    if updated_cache and not retvals['changed']:\r\nKeyError: 'changed'\r\n", "msg": "MODULE FAILURE"}
failed: [app01] (item=[u'apache2', u'libapache2-mod-wsgi', u'python-pip', u'python-virtualenv', u'python-mysqldb']) => {"failed": true, "item": ["apache2", "libapache2-mod-wsgi", "python-pip", "python-virtualenv", "python-mysqldb"], "module_stderr": "Shared connection to app01 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_GKrHoN/ansible_module_apt.py\", line 909, in <module>\r\n    main()\r\n  File \"/tmp/ansible_GKrHoN/ansible_module_apt.py\", line 892, in main\r\n    if updated_cache and not retvals['changed']:\r\nKeyError: 'changed'\r\n", "msg": "MODULE FAILURE"}
    to retry, use: --limit @/home/vagrant/ansible/playbooks/webserver.retry
PLAY RECAP *********************************************************************
app01                      : ok=1    changed=0    unreachable=0    failed=1   
app02                      : ok=1    changed=0    unreachable=0    failed=1   
Ansible playbook :
---
- hosts: webserver
  become: true
  tasks:
    - name: install web components
      apt: name={{item}} state=present update_cache=yes
      with_items:
        - apache2
        - libapache2-mod-wsgi
        - python-pip
        - python-virtualenv
        - python-mysqldb
I'm trying to install few mysql modules on apache app servers but this particular module is blocking me moving forward. I'm clueless at the moment. It would be of great help if someone can help me.
Many Thanks in advance.
