Bug 1500600 - ansible-vault requires either the cryptography library (preferred) or a newer version of pycrypto in order to function
Summary: ansible-vault requires either the cryptography library (preferred) or a newer...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: ansible
Version: el6
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Orphan Owner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-11 07:30 UTC by Juan Orti Alcaine
Modified: 2018-06-26 16:14 UTC (History)
8 users (show)

Fixed In Version: ansible-2.4.1.0-2.el6
Clone Of:
Environment:
Last Closed: 2018-06-26 16:14:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Juan Orti Alcaine 2017-10-11 07:30:18 UTC
Description of problem:

$ ansible -m ping bol-racsalud-901 -i inventory/hosts -vvvv
ansible 2.4.0.0
  config file = /home/jortia/ansible/ansible.cfg
  configured module search path = [u'/home/jortia/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.6.6 (r266:84292, Aug 18 2016, 08:36:59) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
Using /home/jortia/ansible/ansible.cfg as config file
setting up inventory plugins
Parsed /home/jortia/ansible/inventory/hosts inventory source with ini plugin
Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.6/site-packages/ansible/plugins/callback/__init__.pyc
META: ran handlers
ERROR! ansible-vault requires either the cryptography library (preferred) or a newer version of pycrypto in order to function.

$ rpm -qi python-crypto
Name        : python-crypto                Relocations: (not relocatable)
Version     : 2.0.1                             Vendor: Oracle America
Release     : 22.el6                        Build Date: sáb 20 nov 2010 16:40:43 CET
Install Date: jue 08 jun 2017 15:53:41 CEST      Build Host: ca-build19.us.oracle.com
Group       : Development/Libraries         Source RPM: python-crypto-2.0.1-22.el6.src.rpm
Size        : 575118                           License: Public Domain
Signature   : RSA/8, lun 03 ene 2011 21:18:44 CET, Key ID 72f97b74ec551f03
URL         : http://www.amk.ca/python/code/crypto.html
Summary     : Cryptography library for Python
Description :
Python-crypto is a collection of both secure hash functions (such as MD5 and
SHA), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.).

$ rpm -qi python-crypto2.6
Name        : python-crypto2.6             Relocations: (not relocatable)
Version     : 2.6.1                             Vendor: Fedora Project
Release     : 2.el6                         Build Date: vie 13 feb 2015 22:23:34 CET
Install Date: jue 08 jun 2017 16:05:53 CEST      Build Host: buildvm-20.phx2.fedoraproject.org
Group       : Development/Libraries         Source RPM: python-crypto2.6-2.6.1-2.el6.src.rpm
Size        : 2339371                          License: Public Domain and Python
Signature   : RSA/8, vie 13 feb 2015 23:12:40 CET, Key ID 3b49df2a0608b895
Packager    : Fedora Project
URL         : http://www.pycrypto.org/
Summary     : Cryptography library for Python
Description :
PyCrypto is a collection of both secure hash functions (such as MD5 and
SHA), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.).

This package provides the 2.6.x version of PyCrypto

$ yum list installed|grep python-crypto
python-crypto.x86_64                2.0.1-22.el6              @public_ol6_latest
python-crypto2.6.x86_64             2.6.1-2.el6               @epel 

Version-Release number of selected component (if applicable):
ansible-2.4.0.0-2.el6.noarch
python-crypto-2.0.1-22.el6.x86_64
python-crypto2.6-2.6.1-2.el6.x86_64

Additional info:
This is in a Sun Ray server (Oracle Linux 6):
$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.9 (Santiago)
$ cat /etc/oracle-release 
Oracle Linux Server release 6.9

Upstream bug: https://github.com/ansible/ansible/issues/31169

Comment 1 Kevin Fenzi 2017-10-30 20:13:12 UTC
I still intend to get this working for you, but the upstream bug has been closed. 

Do you still want to persue this?

Comment 2 Juan Orti Alcaine 2017-10-30 20:27:21 UTC
(In reply to Kevin Fenzi from comment #1)
> I still intend to get this working for you, but the upstream bug has been
> closed. 
> 
> Do you still want to persue this?

It would be great if it can be done. We use this Oracle Linux 6 to run all our ansible playbooks. If the RHEL6 family is no longer supported we'll be forced to upgrade this box to RHEL7 (not a problem).

Comment 3 Kevin Fenzi 2017-10-30 21:54:01 UTC
Can you try this version: 

https://koji.fedoraproject.org/koji/taskinfo?taskID=22814193

I think I found the issue and fixed it.

Comment 4 Fedora Update System 2017-11-01 16:56:10 UTC
ansible-2.4.1.0-2.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-f1f4d9585b

Comment 5 Juan Orti Alcaine 2017-11-02 13:40:17 UTC
ansible-2.4.1.0-2.el6 works fine with my playbooks using vaults.

Thank you.

Comment 6 Fedora Update System 2017-11-22 04:01:41 UTC
ansible-2.4.1.0-2.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 macbogucki 2018-06-20 09:38:02 UTC
I still have a problem with the nevest ansible

[root@dec ~]# yum list installed|grep python-crypto
python-crypto.x86_64                2.0.1-22.el6                 @anaconda-CentOS-201303020151.x86_64/6.4
python-crypto2.6.x86_64             2.6.1-2.el6                  @epel          
[root@dec ~]# yum list installed|grep ansible
ansible.noarch                      2.5.3-1.el6                  @epel          
[root@dec ~]# 

[bogucki@dec deployment]$ ansible-vault encrypt group_vars/vault-asseco-prd.yml 
New Vault password: 
Confirm New Vault password: 
ERROR! ansible-vault requires either the cryptography library (preferred) or a newer version of pycrypto in order to function.
[bogucki@dec deployment]$

Comment 8 Kevin Fenzi 2018-06-20 18:19:14 UTC
huh, and you are sure thats the ansible-vault from that rpm?

which -a ansible-vault

and 'rpm -qf /usr/bin/ansible-vault' 

and 'ansible-vault --version' 

output please?

Comment 9 macbogucki 2018-06-21 07:14:18 UTC
I'm sure.

[bogucki@dec ~]$ which -a ansible-vault
/usr/bin/ansible-vault
[bogucki@dec ~]$ rpm -qf /usr/bin/ansible-vault 
ansible-2.5.3-1.el6.noarch
[bogucki@dec ~]$ ansible-vault --version
ansible-vault 2.5.3
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/bogucki/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.6/site-packages/ansible
  executable location = /usr/bin/ansible-vault
  python version = 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
[bogucki@dec ~]$

Comment 10 Toshio Kuratomi 2018-06-26 00:25:15 UTC
What about rpm -V ansible and rpm -V python-crypto2.6 ?

Comment 11 Kevin Fenzi 2018-06-26 00:27:34 UTC
I can't get it to duplicate here... 

[kevin@el6-test ~][PROD]$ ansible-vault create  foobar
New Vault password: 
Confirm New Vault password: 
[kevin@el6-test ~][PROD]$ ansible-vault decrypt foobar
Vault password: 
Decryption successful
[kevin@el6-test ~][PROD]$ cat /etc/redhat-release 
CentOS release 6.9 (Final)
[kevin@el6-test ~][PROD]$ rpm -q ansible
ansible-2.5.3-1.el6.noarch
[kevin@el6-test ~][PROD]$ ansible-vault --version
ansible-vault 2.5.3
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/fedora/kevin/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.6/site-packages/ansible
  executable location = /usr/bin/ansible-vault
  python version = 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]

Can you try running it with -vvvv and see if it gives any more info/clues?

Comment 12 macbogucki 2018-06-26 15:23:41 UTC
It must be something on my computer. In the new chroot it works ;)


mkdir -p /opt/chroot-centos-6
rpm -ivh --root=/opt/chroot-centos-6 --nodeps http://rpmfind.net/linux/centos/6.9/os/x86_64/Packages/centos-release-6-9.el6.12.3.x86_64.rpm
yum --installroot=/opt/chroot-centos-6 install bash
rpm -ivh --root=/opt/chroot-centos-6  http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum --installroot=/opt/chroot-centos-6 install  ansible
mount --bind /dev /opt/chroot-centos-6/dev
chroot /opt/chroot-centos-6/ bash

bash-4.1# ansible-vault encrypt  /tmp/vault-asseco-prd.yml 
New Vault password: 
Confirm New Vault password: 
Encryption successful
bash-4.1# 

I'm sorry for wasting You time!

Comment 13 Kevin Fenzi 2018-06-26 16:14:33 UTC
Not a problem at all... I am curious what the issue is though. Please let us know if you find it...


Note You need to log in before you can comment on or make changes to this bug.