Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-deployment.yml fails as pip is unavailable on remote host #108

Open
Xaeco opened this issue Dec 21, 2021 · 2 comments
Open

test-deployment.yml fails as pip is unavailable on remote host #108

Xaeco opened this issue Dec 21, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Xaeco
Copy link

Xaeco commented Dec 21, 2021

On page 100 of

Chapter 4 - Building K8s clusters with Ansible

I inserted a pre-task above the Ensure k8s module dependencies are installed. task

    - name: Install pip3.
      apt: name=python3-pip state=present 

Otherwise it fails with:

PLAY [kube1] *********************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************
ok: [kube1]

TASK [Ensure k8s module dependencies are installed.] *****************************************************************
fatal: [kube1]: FAILED! => {"changed": false, "msg": "Unable to find any of pip3 to use.  pip needs to be installed."}

PLAY RECAP ***********************************************************************************************************
kube1                      : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0    

I am using Ansible in WSL2 which should be fine as the command is executing on the remote host.
In case its relevant:

ansible-playbook [core 2.12.1]
  config file = /mnt/c/Users/<username>/Documents/afk/cluster-local-vms/ansible.cfg
  configured module search path = ['/home/wsl/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']        
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /home/wsl/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
  jinja version = 2.10.1
  libyaml = True
@geerlingguy
Copy link
Owner

I'll have to dig into this one; could be a Python2/Python3 upgrade issue, or I might just need to bump an OS version :)

@geerlingguy geerlingguy added the bug Something isn't working label Dec 21, 2021
@Xaeco
Copy link
Author

Xaeco commented Dec 21, 2021

I'm assuming Ansible is just executing the ansible pip module's statement verbatim on the remote host. Now assuming the latest Ansible module is now targeting pip3 and it's not there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants