/etc/ansible$ ./ec2.py --list
Traceback (most recent call last):
File “./ec2.py”, line 1600, in
Ec2Inventory()
File “./ec2.py”, line 193, in init
self.do_api_calls_update_cache()
File “./ec2.py”, line 527, in do_api_calls_update_cache
self.get_rds_instances_by_region(region)
File “./ec2.py”, line 633, in get_rds_instances_by_region
client = ec2_utils.boto3_inventory_conn(‘client’, ‘rds’, region, **self.credentials)
AttributeError: ‘module’ object has no attribute ‘boto3_inventory_conn’
I have installed boto and boto3 via both apt-get and pip with the same result.
I have found a few other versions of ec2.py but none of them work.
/etc/ansible/ec2.py --list works, but if I try to run from ansible I get this:
~/ansible/playbooks$ ansible -i /etc/ansible/ec2.py -u ubuntu us-east-1d -m ping
Traceback (most recent call last):
File “/usr/local/bin/ansible”, line 4, in import(‘pkg_resources’).run_script(‘ansible==2.3.1.0’, ‘ansible’)
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2927, in @_call_aside
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2913, in _call_aside
f(*args, **kwargs)
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2940, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 635, in _build_master
ws.require(requires)
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 943, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 829, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘pycrypto>=2.6’ distribution was not found and is required by ansible
I installed the python-pycryptopp packge but that didn’t help.