Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Windows Server » How to install Ansible on Windows with Cygwin
  • VBR upgrade to 12.2.3
    Upgrade Veeam Backup and Replication v12.3.x to 12.3.2 Backup
  • How to Enable and use Sudo in Windows 11
    How to Enable and use Sudo in Windows 11 Windows
  • Screenshot 2022 04 27 at 17.51.48
    Remote Desktop Services Setup on Windows Server Windows Server
  • Screensaver
    How to Enable or Disable Screen Saver on Windows Windows
  • AzureMonitor
    Configure Azure Monitor for VMs on Azure Stack Hub AWS/Azure/OpenShift
  • windows 10 bjw3 1280x720 1
    Difference between testing and debugging Windows
  • Veeam Agent Error Fix
    Fixing AIX Veeam agent job startup delay issue Network | Monitoring
  • How to create blue screen using the Not my Fault tool from Sysinternals
    How to create blue screen using the Not my Fault tool from Sysinternals Windows

How to install Ansible on Windows with Cygwin

Posted on 01/03/202028/09/2023 Christian By Christian No Comments on How to install Ansible on Windows with Cygwin
installing Ansible

Ansible is an open-source software provisioning, configuration management, and application-deployment tool enabling infrastructure as code. It runs on many Unix-like systems and can configure both Unix-like systems as well as Microsoft Windows. Installing Ansible generally is pretty straight forward but on windows, it is a little bit complicated. Ansible uses the pywinrm package to communicate with Windows servers over WinRM. It is not installed by default with the Ansible package but can be installed, see the following link. Here are some related contents: How to view installed packages in Cygwin in Windows, how to configure Kerberos for Ansible Authentication, and how to determine Cygwin version.

Cygwin is free software that provides a Unix-like environment and software toolset to users of any modern x86 32-bit and 64-bit versions of Microsoft Windows. Cygwin consists of a Unix system call emulation library, cygwin1.dll, together with a vast set of GNU and other free software applications organized into a large number of optional packages. Among these packages are high-quality compilers and other software development tools, an X11 server, a complete X11 development toolkit, GNU emacs, TeX and LaTeX, OpenSSH (client and server), and much more, including everything needed to compile and use PhysioToolkit software under MS-Windows.

If you wish to install Ansible on Windows, follow these steps.
Note: Cygwin is a simple program that allows UNIX commands to be run on Windows systems. To automate Ansible for VMware Infrastructure Automation.

1. Install cygwin: Here are the steps below to install Cygwin
– From https://cygwin.com/install.html
– Download the installer

Windows

– Run the setup (install) the file that was just downloaded.

Cygwin installation

– on the next page, select the Installation Type

Ansible setup

– Select the root directory (will leave as default)
– Also, select install for all users if multiple users will be using the server

installing Ansible

– Select the Local Package Directory will store installation,( I will leave this as default as it is a test environment). It usually takes (assumes) the location of the initial download file (setup).

C:\Users\tester\Downloads

– Select Connection Type (Select Direct Connection)

Windows

– Choose a download site (will select the first by default)

Cygwin installation

– Click on Next
– This will continue the installation on Cygwin on your windows system and show the progress bar of the installation.

Ansible setup

– Select Packages to install

Windows

2. Install the following packages from the list

- curl
- python
- python-setuptools
- python-crypto
- openssl
- openssl-devel
- libffi-devel
- gcc-g++
- vim
- git

To install, you can use the search menu or expand the packages and from the New drop-down list associated with each package,

– Select install as shown below if you wish to install all the packages associated with the Editor.

Ansible setup

– Or use the search menu for a single package and install.

Cygwin installation

 – For Git

– For Libffi-Devel  which is a portable foreign function interface library

– Click on Next and will prompt a windows allowing you to review and confirm changes.

– This step is a two-step process and will download and then install the following packages on your device.

– Installing the Cygwin onto our system

Note: Do not interrupt this installation as this can take a lot of time.

– Click on Finish when the installation is complete

– Lastly, ensure to set the environment variable for Cygwin (This will enable you to run Cygwin from the terminal). Setting the path and environment variables will differ depending on the version of Windows you have on your computer. Choose a link below for your version of Windows.

– Access the System properties
– Click on System Properties via the Explorer window (Note: There are different steps to launch this window).

Previously this will open the control panel on the fly, but now it will open the Windows About Settings page.

– Then Click on System info and this will open the control panel window.

– Click on Advanced System settings

- Click on Environment Variable
- In the Environment Variable window
- Search for “Path”
- Double click or select and click on edit.
- On the Edit environment variable
- Click on New
- Add the following parameter

– Select on ok.

Note:
– This will ensure all windows are confirmed and ok is clicked about 3x.
– You may have to restart your environment or else this will not work on the fly in order to use Cygwin on Windows CMD.

The steps below are necessary only if you want to explore other methods of installing Ansible on Windows. You can avoid the steps below if you wish to install Ansible with Cygwin as shown below.

For other methods of installing Ansible on Windows, follow the steps below.

Install PIP:  What is PIP?  It is an alternate installer for python packages that many uses in managing python related package activities.

Right-click “Cygwin64 terminal on your desktop” and run as Administrator or run from the CMD because UNIX commands can be run now from the command prompt.

For more information about easy_install and PIP, see https://packaging.python.org/discussions/pip-vs-easy-install/

To install PIP, run the command below.
-Note: If you do not have the right python packages installed, the easy_install pip will not work

easy_install-2.7 pip

Install Pywinrm: Ansible uses the pywinrm package to communicate with Windows servers over WinRM. It is not installed by default with the Ansible package, but can be installed by running the following.

pip install "pywinrm>=0.3.0"

Install Ansible:
Method 1: The best way to achieve this is to install Ansible via Cygwin.
– Select the packages alongside other packages and install them.

Method 2. Use the command below.

- pip install Ansible

Note: You need also to rebase all the packages to solve the problem of forking. For this perform the following below.

  1. Rebase-trigger full
  2. Close Cygwin shells (or even reboot your windows)
  3. Run Cygwin installer again and just click on “Next” until you reach the end of the installation, then Cygwin will rebase all the packages.
Building wheel for ansible (setup.py) ... done
  Created wheel for ansible: filename=ansible-2.9.5-cp27-none-any.whl size=16162543 sha256=b83577e80aa8c47d9647ed665de4bf59d7a45e7c3d128dc5f565ab9dc9841d32

Stored in directory: /home/tester/.cache/pip/wheels/3b/ab/74/4629c803bf5475edf5c0369f5cb95e834bdd2f7d70f439a027
Successfully built ansible
Installing collected packages: ansible
Successfully installed ansible-2.9.5
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

To run Ansible on other Operating Systems, see https://techdirectarchive.com/2020/02/23/ansible-installation-and-configuration-on-ubuntu/

After installing Ansible, using the version to see if Ansible is correctly installed.

$ ansible --version
$ ansible --version
ansible 2.9.5
  config file = None
  configured module search path = [u'/home/tester/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.16 (default, Mar 20 2019, 12:15:19) [GCC 7.4.0]

To see the default host files, navigate to the path C:\cygwin64\etc\ansible

Now that Ansible is installed, let’s perform our first test. The below steps and command helps to test Ansible locally. Running some commands like ping by using the ping Ansible module against the localhost.

You will get a success message displayed in green after completion of the ping commands. – Response will to the ping command is the “pong” output.

ansible localhost -m ping
Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Windows Server Tags:Configuration Management Tool, Cygwin, Microsoft Windows, Orchestration Tool

Post navigation

Previous Post: Various ways to hide Windows Taskbar
Next Post: How to install additional packages via Cygwin

Related Posts

  • 1 kAUgwdVYmcVgUSXiwUkObw
    Error 0x801c001d – Automatic registration failed: Failed to look up the registration service from AD Windows Server
  • PowerShell logo
    PowerShell: How to update PowerShellGet and Package Management Windows Server
  • featured 2 2
    Clone a repository and install software from GitHub on Windows Windows Server
  • Ping 4
    Perform continuous ping on OSes and network Appliances Mac
  • How to Check what files are taking up space
    How to Check what files are taking up space on Windows 11 Windows
  • Migrate RDS CALs
    How to Migrate RDS CALs Windows

More Related Articles

1 kAUgwdVYmcVgUSXiwUkObw Error 0x801c001d – Automatic registration failed: Failed to look up the registration service from AD Windows Server
PowerShell logo PowerShell: How to update PowerShellGet and Package Management Windows Server
featured 2 2 Clone a repository and install software from GitHub on Windows Windows Server
Ping 4 Perform continuous ping on OSes and network Appliances Mac
How to Check what files are taking up space How to Check what files are taking up space on Windows 11 Windows
Migrate RDS CALs How to Migrate RDS CALs Windows

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • VBR upgrade to 12.2.3
    Upgrade Veeam Backup and Replication v12.3.x to 12.3.2 Backup
  • How to Enable and use Sudo in Windows 11
    How to Enable and use Sudo in Windows 11 Windows
  • Screenshot 2022 04 27 at 17.51.48
    Remote Desktop Services Setup on Windows Server Windows Server
  • Screensaver
    How to Enable or Disable Screen Saver on Windows Windows
  • AzureMonitor
    Configure Azure Monitor for VMs on Azure Stack Hub AWS/Azure/OpenShift
  • windows 10 bjw3 1280x720 1
    Difference between testing and debugging Windows
  • Veeam Agent Error Fix
    Fixing AIX Veeam agent job startup delay issue Network | Monitoring
  • How to create blue screen using the Not my Fault tool from Sysinternals
    How to create blue screen using the Not my Fault tool from Sysinternals Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,836 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.