Ansible: Setting up to manage Windows

This guide shows the procedures for setting up to manage Windows Server with Ansible to do on the Ansible Controller.

At this time, I installed Ansible 2.9 to CentOS 8.4.
This guide is also available offline (blocked internet access) situations.

Note: About installation of Ansible 7 to CentOS Steam 9 is the following post.
>> Ansible: How to install ansible 7 (available offline (blocked internet access) situations)

Note: About setting up on the targets (Windows Server) is the following post.
>> Ansible: Setting up on targets (Windows Server)

Preparations

Make dnf (yum) command add packages from ISO (if offline)

If your environment is offline (blocked internet access), refer to the following post and make dnf (yum) command add packages from mounted DVD / ISO image.

>> How to add packages from DVD / ISO by dnf (yum) on Linux

Install Python 3.x

Refer to the following post and install newer Python 3.x.
Note: Default Python3 version on RHEL 8.4 is Python 3.6.

>> How to install Python 3.x from source on Linux

Procedures

1. Install Ansible

In the case of online

(1) Change user to whom run Ansible.

su infraya

(2) Change directory to the Ansible user’s home.

cd

(3) Install specific version of Ansible by pip3.

pip3 install ansible\==2.9.27

If it shows the following, Ansible is installed successfully.

Successfully installed ansible-2.9.27

For offline

If your environment is offline (blocked internet access), refer to the following post and install Ansible.
>> Ansible: How to install on offline environment

2. Install pywinrm

For online

Install pywinrm so that Ansible Controller can connect to Windows Server by WinRM.

pip3 install pywinrm

If it shows like the following, installed successfully.

Successfully installed pywinrm-0.4.2

For offline

If your environment is offline (blocked internet access), refer to the following post and install pywinrm.
>> How to install pywinrm on offline environment

4. Install requests_credssp

For online

Install requests_credssp if you use CredSSP to connect between Ansible Controller and Windows Server..

pip3 install requests_credssp

If it shows like the following, installed successfully.

Successfully installed requests-credssp-2.0.0

For offline

If your environment is offline (blocked internet access), refer to the following post and install requests_credssp.
>> How to install requests_credssp on offline environment

On the Ansible Controller, that’s about it.
If you proceed to set up on the Windows Server targets, refer to the following post.
>> Ansible: Setting up on targets (Windows Server)