2

I have a control host that has the following:

  • ansible --version = 2.5.2
  • tower-cli --version == 3.3.0

tower-cli is able to connect to a remote Ansible Tower instance (note, Ansible tower itself is not installed on this control host). Can run 'tower-cli user list' on control host and works as expected.

However, when I try to use a playbook with the tower_* modules, such as:

  tasks:
  - name: create the SCM project
    tower_project:
      name: "test project"
      state: present
      ...

Always getting the following:

ansible-tower-cli required for this module

Any ideas, as I can use tower-cli just fine on this localhost that is running the playbook.

1 Answer 1

2

Found the origin of the issue, and unless someone else had run into it they wouldn't have known where to look --

check details of tower-cli --version and ansible --version, as well as which tower-cli which ansible; in my case were installed in different python environments:

/usr/lib/python2.6/site-packages/ansible

/usr/lib/python3.4/site-packages/tower_cli

If you cannot see the python version using the above for tower-cli, you can run:

$ head -n1 `which tower-cli`
#!/usr/local/opt/python/bin/python3.7
$ 

The ansible modules couldn't see the tower_cli python modules as they were in a different python environment.

After-the-fact problem origin: I had installed ansible via yum (package manager), and ansible-tower-cli via pip (python installer). Being consistent in how you install both to make sure they go to the same environment resolves the issue.

Centos/RHEL: yum install ansible ansible-tower-cli

-OR-

Python: pip install ansible

Python: pip install ansible-tower-cli

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.