geerlingguy / ansible-for-kubernetes

Ansible and Kubernetes examples from Ansible for Kubernetes Book
https://www.ansibleforkubernetes.com
MIT License
691 stars 314 forks source link

Slight changes required when installing Ansible inside Bash on Ubuntu #104

Open Xaeco opened 2 years ago

Xaeco commented 2 years ago

Under

Installing Ansible inside Bash on Ubuntu

When running:

$ sudo apt-get install -y python-pip python-dev

Returns:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'python-dev-is-python2' instead of 'python-dev'
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python3-pip

E: Package 'python-pip' has no installation candidate

Modified the command to:

$ sudo apt-get install -y python3-pip python-dev

Then:

$ ansible --version
ansible [core 2.12.1]
  config file = None
  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
  python version = 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0]
  jinja version = 2.10.1
  libyaml = True

WSL Linux Distro:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal
geerlingguy commented 2 years ago

Thanks, this definitely needs updating. I think I initially wrote this in the early version of WSL1 with Ubuntu 18.04 and Python 2.7!