Installing ansible on Windows 10

Hi I watched the Ansible for dev ops Youtube video and following instructions therein tried to install ansible on windows 10 machine using
pip install ansible
I am running python 3.8.5

after I got this message “A required privilege is not held by the client:”, I opened a command prompt as administrator and retried that pip command.

Now I get
“error: can’t copy ‘lib\ansible\module_utils\ansible_release.py’: doesn’t exist or not a regular file”

I searched this string on this group but found no hits, so I’m hoping someone could help me.

thanks

We do not support installing Ansible on Windows. You will need to use some form of VM to run it from a Linux like OS. Many in your situation utilize WSL/WSL2 for this purpose.

If you are unable to switch to linux, a workaround for your issue could be to install WSL on your windows machine, and then install ansible on wsl.
Works without issues. If you’ve seen video about installing ansible on windows, it must have been somethin in that vein.
One thing to note, however, is that you will not be able to run ansible in Windows native directories (/mnt/c usually), as they need to have 777 permission set simulated. Ansible will refuse to run in a world writtable directory, so place your config file somewhere in your WSL hone directory (/home/username)

https://docs.microsoft.com/en-us/windows/wsl/install-win10 ← follow this guide.

Not yet sure how it works with WSL2, i haven’t tested it yet.

Alternatively, install Linux VM of your choice on top of windows, and run ansible there.

Dana petak, 7. kolovoza 2020. u 03:12:14 UTC+2, korisnik Charles Leviton napisao je:

Thank you I could install a Linux VM and install ansible w/in that. again according to that video I should be able to confirm the installation by using the trusted --version command. But evidently something is not right

osboxes@osboxes:~$ pip3 install ansible
Processing ./.cache/pip/wheels/96/b5/fc/646cc0302950f9dd85ce04f1108809447c7c1c20ebf23f587b/ansible-2.9.11-py3-none-any.whl
Requirement already satisfied: cryptography in /usr/lib/python3/dist-packages (from ansible) (2.8)
Requirement already satisfied: jinja2 in ./.local/lib/python3.8/site-packages (from ansible) (2.11.2)
Requirement already satisfied: PyYAML in /usr/lib/python3/dist-packages (from ansible) (5.3.1)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib/python3/dist-packages (from jinja2->ansible) (1.1.0)
Installing collected packages: ansible
Successfully installed ansible-2.9.11
osboxes@osboxes:~$ ansible --version
bash: ansible: command not found
osboxes@osboxes:~$

My linux skills are rudimentary (Does that preclude me from proceeding with this exercise? do tell me). I thought maybe I have to explicitly add the folder for the ansible executable to my $PATH to which end I tried
osboxes@osboxes:~$ locate ansible
but it returned nothing

Then I had the bright idea of installing it via the Software Manager. It installed 2.9.6, rather than 2.9.11, but I doubt if that’s a show stopper. All good now :slight_smile:

It might be installed to $HOME/.local/bin. If you can find ansible in this directory, add it to your PATH variable ($HOME/.profile: export PATH=“$PATH:$HOME/.local/bin”) and login again.