Ansible - Generating OpenSSL Private Keys

Hello!
I installed pyOpenSSL with this command: “yum install pyOpenSSL”

Then I try to run an Ansible playbook which generates a public key but I got this error: "FAILED! => {“changed”: false, “failed”: true, “msg”: “the python pyOpenSSL module is required}”

Anyone knows why? I know I have pyOpenSSL because when I check it, I get this message: “Package python26-pyOpenSSL-0.10-2.8.amzn1.x86_64 already installed and latest version”

My playbook code is:
-openssl_privatekey:
path: /etc/ssl/private/ansible.com.pem
size: 2048

Thank you in advance.