Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible roles/packages - Ansible Galaxy - error on installation MAC OSX

Im trying to install ansible-galaxy roles on Mac OS X El Capitan via CLI

$ ansible-galaxy install -r requirements.yml

I am getting this error:

ERROR! Unexpected Exception: (setuptools 1.1.6 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('setuptools>=11.3'))
the full traceback was:

Traceback (most recent call last):
  File "/usr/local/bin/ansible-galaxy", line 73, in <module>
    mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
  File "/Library/Python/2.7/site-packages/ansible/cli/galaxy.py", line 38, in <module>
    from ansible.galaxy.role import GalaxyRole
  File "/Library/Python/2.7/site-packages/ansible/galaxy/role.py", line 35, in <module>
    from ansible.playbook.role.requirement import RoleRequirement
  File "/Library/Python/2.7/site-packages/ansible/playbook/__init__.py", line 25, in <module>
    from ansible.playbook.play import Play
  File "/Library/Python/2.7/site-packages/ansible/playbook/play.py", line 27, in <module>
    from ansible.playbook.base import Base
  File "/Library/Python/2.7/site-packages/ansible/playbook/base.py", line 35, in <module>
    from ansible.parsing.dataloader import DataLoader
  File "/Library/Python/2.7/site-packages/ansible/parsing/dataloader.py", line 32, in <module>
    from ansible.parsing.vault import VaultLib
  File "/Library/Python/2.7/site-packages/ansible/parsing/vault/__init__.py", line 67, in <module>
    from cryptography.hazmat.primitives.hashes import SHA256 as c_SHA256
  File "/Library/Python/2.7/site-packages/cryptography/hazmat/primitives/hashes.py", line 15, in <module>
    from cryptography.hazmat.backends.interfaces import HashBackend
  File "/Library/Python/2.7/site-packages/cryptography/hazmat/backends/__init__.py", line 7, in <module>
    import pkg_resources
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2797, in <module>
    parse_requirements(__requires__), Environment()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 580, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
VersionConflict: (setuptools 1.1.6 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('setuptools>=11.3'))
like image 476
Frederico Cerdeira Avatar asked Apr 30 '16 17:04

Frederico Cerdeira


People also ask

How do we install ansible Galaxy roles?

You can initialize a new galaxy role using ansible-galaxy init , or you can install a role directly from the Ansible Galaxy role store by executing the command ansible-galaxy install <name of role> .

Under which conditions can ansible Galaxy be used to install roles?

When set, the ANSIBLE_ROLES_PATH variable is used during playbook execution to locate installed roles, and by ansible-galaxy to determine where to install roles. It can be set to a single directory path, or to a list of paths (e.g., /etc/ansible/roles:~/. ansible/roles).

What is the difference between ansible and ansible galaxy?

Ansible is an open-source configuration management tool while Ansible Galaxy is a repository for Ansible roles. Ansible Galaxy for Ansible is what PyPI is for Python, or what Maven is for Java.

Where are ansible galaxy collections installed?

By default, ansible-galaxy collection install uses https://galaxy.ansible.com as the Galaxy server (as listed in the ansible. cfg file under GALAXY_SERVER). You do not need any further configuration.


1 Answers

Run the following to upgrade setuptools under the python user:

pip install --upgrade setuptools --user python

For some reason, the way things are installed inside OS X (and in my case, under CentOS 7 inside a Docker container), the setuptools package doesn't get installed correctly under the right user.

like image 171
geerlingguy Avatar answered Oct 09 '22 22:10

geerlingguy