Skip to content

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

Open
@Xaeco

Description

@Xaeco

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions