redgiant
redgiant

Reputation: 504

ansible 2.3.1.0 install only from files

I need to install ansible-2.3.1.0 only from files I copy to a firewalled host. The internally-supported pip install only grabs ansible 1.x, so I can't use that.

The default Python on the online host is 2.7.12, and the offline host 2.7.6.

Here's what I did

# on a separate host that can access the internet ...
ssh online_host
mkdir ~/ansible
cd ~/ansible

# download ansible and first-level requirements dependency tarballs
pip install --download . ansible
tar xvf ansible-2.3.1.0.tar.gz
pip install --download . -r ansible-2.3.1.0/requirements.txt

# this gave me these tarballs
ansible-2.3.1.0.tar.gz
Jinja2-2.9.6.tar.gz
paramiko-2.2.1.tar.gz
pycrypto-2.6.1.tar.gz
PyYAML-3.12.tar.gz

# install on the offline host
ssh offline_host
# the tarballs above were copied to here
cd ~/ansible
# unpack and offline install it
sudo pip install ansible-2.3.1.0.tar.gz --no-index --find-links file://`pwd`

But when I try to run ansible, it give me this:

ansible
Traceback (most recent call last):
  File "/usr/bin/ansible", line 25, in <module>
    from ansible.runner import Runner
ImportError: No module named runner

Has anyone actually installed ansible 2.3 like this? What am I missing?

I tried looking at deeper dependencies but I coulnd't figure out what this might be from (I see something about Ansible API changes from 1.x to 2.x, but I can't figure out from that what is up or what would fix this in my case.

EDIT:

After copying /usr/local/bin/ansible* over /usr/bin to rid myself of old 1.x leftover ansible command wrappers, the commands now start but when I run a playbook I get this (omitting playbook and ansible-playbook command-line since I don't think they matter):

TASK [Gathering Facts] *******************************************************************************************************
fatal: [slcmskafka-1169389.stratus.slc.ebay.com]: 
FAILED! => {"changed": false, "failed": true, "msg": 
"Unsupported parameters for (setup) module: gather_subset,gather_timeout.
Supported parameters include: fact_path,filter"}

Upvotes: 1

Views: 3474

Answers (1)

redgiant
redgiant

Reputation: 504

Fixed.

I more thoroughly removed an older Ansible by this:

sudo pip uninstall ansible
# didn't need to autoremove
sudo apt-get remove ansible

then the /usr/local/bin/ansible* commands worked (and there were no longer any older /usr/bin/ansible* commands to replace) and my playbooks work too.

Upvotes: 2

Related Questions