Installing Ansible on my Windows 11 Home Laptop

1) Install Windows Subsystem for Linux

Open powershell as an administrator and run:

wsl --install

Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64)

  • Documentation:  https://help.ubuntu.com
  • Management:     https://landscape.canonical.com
  • Support:        https://ubuntu.com/advantage
2) Install Ansible in Ubuntu

From your myunixuser@device:~$ prompt, run the following commands.

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible


Note: These are the commands from:
Installing Ansible on specific operating systems — Ansible Documentation


THE END!

Appendix: Output from Installing Ansible on Ubuntu on Windows 11

myunixuser@yourdevice:~$ sudo apt update
[sudo] password for myunixuser:
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1107 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [240 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [16.1 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [1037 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [168 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [536 B]
Get:10 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [995 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [218 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [22.0 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [41.6 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [9768 B]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [472 B]
Get:16 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [64.2 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [10.5 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]
Get:19 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [27.8 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [16.4 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [644 B]
Get:22 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:23 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [896 kB]
Get:24 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [180 kB]
Get:25 http://security.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [11.4 kB]
Get:26 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [1016 kB]
Get:27 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [164 kB]
Get:28 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [536 B]
Get:29 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [793 kB]
Get:30 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [145 kB]
Get:31 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [16.7 kB]
Get:32 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [36.5 kB]
Get:33 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [7060 B]
Get:34 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [260 B]
Fetched 7580 kB in 9s (845 kB/s)
myunixuser@yourdevice:~$
Building dependency tree... Done
Reading state information... Done
161 packages can be upgraded. Run 'apt list --upgradable' to see them.
myunixuser@yourdevice:~$ sudo apt install software-properties-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  python3-software-properties
The following packages will be upgraded:
  python3-software-properties software-properties-common
2 upgraded, 0 newly installed, 0 to remove and 159 not upgraded.
Need to get 42.9 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 software-properties-common all 0.99.22.7 [14.1 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-software-properties all 0.99.22.7 [28.8 kB]
Fetched 42.9 kB in 1s (36.5 kB/s)
(Reading database ... 31314 files and directories currently installed.)
Preparing to unpack .../software-properties-common_0.99.22.7_all.deb ...
Unpacking software-properties-common (0.99.22.7) over (0.99.22.4) ...
Preparing to unpack .../python3-software-properties_0.99.22.7_all.deb ...
Unpacking python3-software-properties (0.99.22.7) over (0.99.22.4) ...
Setting up python3-software-properties (0.99.22.7) ...
Setting up software-properties-common (0.99.22.7) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
myunixuser@yourdevice:~$ sudo add-apt-repository --yes --update ppa:ansible/ansible
Repository: 'deb https://ppa.launchpadcontent.net/ansible/ansible/ubuntu/ jammy main'
Description:
Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.

http://ansible.com/


If you face any issues while installing Ansible PPA, file an issue here:
https://github.com/ansible-community/ppa/issues
More info: https://launchpad.net/~ansible/+archive/ubuntu/ansible
Adding repository.
Adding deb entry to /etc/apt/sources.list.d/ansible-ubuntu-ansible-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/ansible-ubuntu-ansible-jammy.list
Adding key to /etc/apt/trusted.gpg.d/ansible-ubuntu-ansible.gpg with fingerprint 6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:5 https://ppa.launchpadcontent.net/ansible/ansible/ubuntu jammy InRelease [18.0 kB]
Get:6 https://ppa.launchpadcontent.net/ansible/ansible/ubuntu jammy/main amd64 Packages [1140 B]
Get:7 https://ppa.launchpadcontent.net/ansible/ansible/ubuntu jammy/main Translation-en [752 B]
Fetched 130 kB in 3s (45.9 kB/s)
Reading package lists... Done
myunixuser@yourdevice:~$ sudo apt install ansible
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  ansible-core python-babel-localedata python3-babel python3-bcrypt python3-certifi python3-chardet python3-idna
  python3-jinja2 python3-jmespath python3-kerberos python3-markupsafe python3-nacl python3-ntlm-auth python3-packaging
  python3-paramiko python3-requests python3-requests-kerberos python3-requests-ntlm python3-resolvelib python3-tz
  python3-urllib3 python3-winrm python3-xmltodict sshpass
Suggested packages:
  python-jinja2-doc python-nacl-doc python3-gssapi python3-invoke python3-openssl python3-socks python-requests-doc
The following NEW packages will be installed:
  ansible ansible-core python-babel-localedata python3-babel python3-bcrypt python3-certifi python3-chardet
  python3-idna python3-jinja2 python3-jmespath python3-kerberos python3-markupsafe python3-nacl python3-ntlm-auth
  python3-packaging python3-paramiko python3-requests python3-requests-kerberos python3-requests-ntlm
  python3-resolvelib python3-tz python3-urllib3 python3-winrm python3-xmltodict sshpass
0 upgraded, 25 newly installed, 0 to remove and 159 not upgraded.
Need to get 23.5 MB of archives.
After this operation, 316 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 python-babel-localedata all 2.8.0+dfsg.1-7 [4982 kB]
Get:2 https://ppa.launchpadcontent.net/ansible/ansible/ubuntu jammy/main amd64 ansible-core all 2.15.5-1ppa~jammy [1025 kB]
Get:3 https://ppa.launchpadcontent.net/ansible/ansible/ubuntu jammy/main amd64 ansible all 8.5.0-1ppa~jammy [16.4 MB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-tz all 2022.1-1ubuntu0.22.04.1 [30.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-babel all 2.8.0+dfsg.1-7 [85.1 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-markupsafe amd64 2.0.1-2build1 [12.7 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-jinja2 all 3.0.3-1 [108 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-packaging all 21.3-1 [30.7 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/universe amd64 python3-resolvelib all 0.8.1-1 [23.6 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-certifi all 2020.6.20-1 [150 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-chardet all 4.0.0-1 [98.0 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-idna all 3.3-1 [49.3 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-jmespath all 0.10.0-1 [21.7 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy/universe amd64 python3-kerberos amd64 1.1.14-3.1build5 [23.0 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-nacl amd64 1.5.0-2 [63.1 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy/universe amd64 python3-ntlm-auth all 1.4.0-1 [20.4 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-bcrypt amd64 3.2.0-1build1 [32.7 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-paramiko all 2.9.3-0ubuntu1 [133 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-urllib3 all 1.26.5-1~exp1 [96.4 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-requests all 2.25.1+dfsg-2ubuntu0.1 [48.8 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy/universe amd64 python3-requests-kerberos all 0.12.0-2 [11.9 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy/universe amd64 python3-requests-ntlm all 1.1.0-1.1 [6160 B]
Get:23 http://archive.ubuntu.com/ubuntu jammy/universe amd64 python3-xmltodict all 0.12.0-2 [12.6 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy/universe amd64 python3-winrm all 0.3.0-2 [21.7 kB]
Get:25 http://archive.ubuntu.com/ubuntu jammy/universe amd64 sshpass amd64 1.09-1 [11.7 kB]
Fetched 23.5 MB in 5s (4494 kB/s)
Selecting previously unselected package python-babel-localedata.
(Reading database ... 31314 files and directories currently installed.)
Preparing to unpack .../00-python-babel-localedata_2.8.0+dfsg.1-7_all.deb ...
Unpacking python-babel-localedata (2.8.0+dfsg.1-7) ...
Selecting previously unselected package python3-tz.
Preparing to unpack .../01-python3-tz_2022.1-1ubuntu0.22.04.1_all.deb ...
Unpacking python3-tz (2022.1-1ubuntu0.22.04.1) ...
Selecting previously unselected package python3-babel.
Preparing to unpack .../02-python3-babel_2.8.0+dfsg.1-7_all.deb ...
Unpacking python3-babel (2.8.0+dfsg.1-7) ...
Selecting previously unselected package python3-markupsafe.
Preparing to unpack .../03-python3-markupsafe_2.0.1-2build1_amd64.deb ...
Unpacking python3-markupsafe (2.0.1-2build1) ...
Selecting previously unselected package python3-jinja2.
Preparing to unpack .../04-python3-jinja2_3.0.3-1_all.deb ...
Unpacking python3-jinja2 (3.0.3-1) ...
Selecting previously unselected package python3-packaging.
Preparing to unpack .../05-python3-packaging_21.3-1_all.deb ...
Unpacking python3-packaging (21.3-1) ...
Selecting previously unselected package python3-resolvelib.
Preparing to unpack .../06-python3-resolvelib_0.8.1-1_all.deb ...
Unpacking python3-resolvelib (0.8.1-1) ...
Selecting previously unselected package ansible-core.
Preparing to unpack .../07-ansible-core_2.15.5-1ppa~jammy_all.deb ...
Unpacking ansible-core (2.15.5-1ppa~jammy) ...
Selecting previously unselected package ansible.
Preparing to unpack .../08-ansible_8.5.0-1ppa~jammy_all.deb ...
Unpacking ansible (8.5.0-1ppa~jammy) ...
Selecting previously unselected package python3-certifi.
Preparing to unpack .../09-python3-certifi_2020.6.20-1_all.deb ...
Unpacking python3-certifi (2020.6.20-1) ...
Selecting previously unselected package python3-chardet.
Preparing to unpack .../10-python3-chardet_4.0.0-1_all.deb ...
Unpacking python3-chardet (4.0.0-1) ...
Selecting previously unselected package python3-idna.
Preparing to unpack .../11-python3-idna_3.3-1_all.deb ...
Unpacking python3-idna (3.3-1) ...
Selecting previously unselected package python3-jmespath.
Preparing to unpack .../12-python3-jmespath_0.10.0-1_all.deb ...
Unpacking python3-jmespath (0.10.0-1) ...
Selecting previously unselected package python3-kerberos.
Preparing to unpack .../13-python3-kerberos_1.1.14-3.1build5_amd64.deb ...
Unpacking python3-kerberos (1.1.14-3.1build5) ...
Selecting previously unselected package python3-nacl.
Preparing to unpack .../14-python3-nacl_1.5.0-2_amd64.deb ...
Unpacking python3-nacl (1.5.0-2) ...
Selecting previously unselected package python3-ntlm-auth.
Preparing to unpack .../15-python3-ntlm-auth_1.4.0-1_all.deb ...
Unpacking python3-ntlm-auth (1.4.0-1) ...
Selecting previously unselected package python3-bcrypt.
Preparing to unpack .../16-python3-bcrypt_3.2.0-1build1_amd64.deb ...
Unpacking python3-bcrypt (3.2.0-1build1) ...
Selecting previously unselected package python3-paramiko.
Preparing to unpack .../17-python3-paramiko_2.9.3-0ubuntu1_all.deb ...
Unpacking python3-paramiko (2.9.3-0ubuntu1) ...
Selecting previously unselected package python3-urllib3.
Preparing to unpack .../18-python3-urllib3_1.26.5-1~exp1_all.deb ...
Unpacking python3-urllib3 (1.26.5-1~exp1) ...
Selecting previously unselected package python3-requests.
Preparing to unpack .../19-python3-requests_2.25.1+dfsg-2ubuntu0.1_all.deb ...
Unpacking python3-requests (2.25.1+dfsg-2ubuntu0.1) ...
Selecting previously unselected package python3-requests-kerberos.
Preparing to unpack .../20-python3-requests-kerberos_0.12.0-2_all.deb ...
Unpacking python3-requests-kerberos (0.12.0-2) ...
Selecting previously unselected package python3-requests-ntlm.
Preparing to unpack .../21-python3-requests-ntlm_1.1.0-1.1_all.deb ...
Unpacking python3-requests-ntlm (1.1.0-1.1) ...
Selecting previously unselected package python3-xmltodict.
Preparing to unpack .../22-python3-xmltodict_0.12.0-2_all.deb ...
Unpacking python3-xmltodict (0.12.0-2) ...
Selecting previously unselected package python3-winrm.
Preparing to unpack .../23-python3-winrm_0.3.0-2_all.deb ...
Unpacking python3-winrm (0.3.0-2) ...
Selecting previously unselected package sshpass.
Preparing to unpack .../24-sshpass_1.09-1_amd64.deb ...
Unpacking sshpass (1.09-1) ...
Setting up python3-ntlm-auth (1.4.0-1) ...
Setting up python3-bcrypt (3.2.0-1build1) ...
Setting up python3-resolvelib (0.8.1-1) ...
Setting up python3-kerberos (1.1.14-3.1build5) ...
Setting up python3-markupsafe (2.0.1-2build1) ...
Setting up sshpass (1.09-1) ...
Setting up python3-tz (2022.1-1ubuntu0.22.04.1) ...
Setting up python-babel-localedata (2.8.0+dfsg.1-7) ...
Setting up python3-xmltodict (0.12.0-2) ...
Setting up python3-packaging (21.3-1) ...
Setting up python3-chardet (4.0.0-1) ...
Setting up python3-certifi (2020.6.20-1) ...
Setting up python3-jmespath (0.10.0-1) ...
Setting up python3-idna (3.3-1) ...
Setting up python3-urllib3 (1.26.5-1~exp1) ...
Setting up python3-nacl (1.5.0-2) ...
Setting up python3-babel (2.8.0+dfsg.1-7) ...
update-alternatives: using /usr/bin/pybabel-python3 to provide /usr/bin/pybabel (pybabel) in auto mode
Setting up python3-jinja2 (3.0.3-1) ...
Setting up python3-requests (2.25.1+dfsg-2ubuntu0.1) ...
Setting up python3-requests-kerberos (0.12.0-2) ...
Setting up python3-paramiko (2.9.3-0ubuntu1) ...
Setting up python3-requests-ntlm (1.1.0-1.1) ...
Setting up ansible-core (2.15.5-1ppa~jammy) ...
Setting up python3-winrm (0.3.0-2) ...
Setting up ansible (8.5.0-1ppa~jammy) ...
Processing triggers for man-db (2.10.2-1) ...
myunixuser@yourdevice:~$

Note: I nearly forgot the myunixuser because I'd barely used it. Fortunately it was one of my commonly used for testing passwords.


Comments