Installing Ansible 2.2 on Fedora 2525 November 2016 · Filed in Tutorial
As part of my ongoing investigation of the usability of various Linux distributions and desktop environments, I’ve been working with Fedora 25. As part of the investigation I need to see how to perform certain tasks, one of which is working with Ansible. As a result, I needed to install Ansible 2.2 on Fedora 25, and it turns out it wasn’t as simple as
pip install ansible.
I generally prefer to run Ansible in a Python virtualenv, but I don’t believe that it will make any difference to this procedure. However, I’m happy to be corrected if someone knows otherwise.
To create a Python virtualenv, you’ll first need virtualenv installed. I prefer to install virtualenv globally for all users using this command:
sudo -H pip install virtualenv
Once virtualenv is installed, then create a virtualenv for Ansible:
virtualenv ~/Envs ansible
Then activate the virtualenv:
At this point, you can try a
pip install ansible, but it will fail. First, you need to install some additional development libraries that are required in order to install Ansible:
sudo dnf install libffi-devel redhat-rpm-config python-devel openssl-devel
Once those packages are installed, then you’re finally ready to install Ansible into the virtualenv:
pip install ansible
sudo is not used here because you are installing Ansible into your own virtual environment.)
That’s it—you’re now ready to roll. Enjoy!Tags: Ansible · CLI · Fedora · Linux · Python Previous Post: Using GNOME Keyring for Git Credentials on Fedora 25 Next Post: Liveblog: Scaling to Your First 10 Million Users