Ansible is a very powerful automation tool that is developed from RedHat. Many large organizations rely on Ansible to automate tasks and procedures. In this article I will explain how one can use ansible to manage windows clients and servers.
In order to manage windows hosts ansible winrm plugin should be used to communicate with the client/server machine.
The first step is to verify that ansible is installed.
Alongside with ansible, on the control node the pywinrm module should be also installed. By default this one is not installed and one should do it manually.
The managed Windows client/server machines should be configured to allow remote connections. A very useful power shell script is already developed from other users and it needs only to be executed on the managed host.
If your execution policy is prohibiting this script to be executed, you should set-execution policy to RemoteSigned as shown below and then execute the powershell.
Control node should have network connectivity with the managed hosts.
Some environmental variables should be used, so that ansible knows how the connection will be performed (winrm). I included those variables in my inventory file as I created this lab just for demonstration. My inventory file looks like below:
Lastly make sure that the user that is used for the connection has administrative rights on the managed windows hosts. Otherwise some error codes will be returned.
Lastly confirm ansible on managed host is working by using win_ping module.
In this article I will explain a HAproxy installation on docker centos images. First things first, 3 centos images should be deployed. Two of them will be simple web servers with httpd installed and the third one will have haproxy installed to load balance between the two web servers.
In order to deploy 3 new centos docker images you should first download the latest centos image.
Just pull the Centos docker image from dockerHub by using the below command
In order to deploy a CentOS container with systemd enabled to perform and use commands as systemctl you could do the following:
Download the official Centos image with systemd integrated from DockerHub and create a file name Dockerfile on your current working directory. The following dockerfile will install/enable httpd package with yum and systemctl.