• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Debian

How to Install and Configure Ansible on Debian 9 for Use With Windows Server

How VPS by How VPS
November 1, 2019
in Debian
0
0
SHARES
30
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Using a Different System?
  2. Prerequisites
  3. Installation
    1. Confirm the Ansible Installation
  4. Configure Ansible for Windows Server Management
  5. Configure the Windows Server
  6. Want to contribute?

Using a Different System?

  • How to Install and Configure Ansible on CentOS 7 for Use With Windows Server

Are we missing a guide for your target system? Request one, or submit your own!


Ansible is an open source tool for automating tasks. It manages the configuration of your Linux and Windows servers. It works without an agent which means that Ansible uses SSH and current user SSH authorization.

You can use Ansible to automate three types of tasks:

  • Provisioning: Set up several servers you need in your infrastructure.
  • Configuration management: Change the configuration of an application, OS, or device; start and stop services; install or update applications; implement a security policy; or perform a wide variety of other configuration tasks.
  • Application deployment: Make DevOps easier by automating the deployment of internally developed applications to your production systems.

This article will guide you through the install and setup process for Ansible on Debian Stretch, as well the configuration for the administration of a machine that’s running on a Windows Server.

Prerequisites

  • A sudo user.
  • A Debian 9 “Stretch” server instance.

Installation

Add the following line to the /etc/apt/sources.list.

deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main

Add the repo keys.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367

Update the system.

sudo apt-get update

Install Ansible.

sudo apt-get install ansible

To administer your Windows servers, you will need to install the following packages:

  • python-pip
  • pip
  • pywinrm

Install the Python packages.

sudo apt-get install python-pip pip

Install WinRM (Windows Remote Management).

sudo apt-get install pywinrm

Confirm the Ansible Installation

Test the Ansible installation by retrieving its version using the following command.

ansible --version
ansible 2.4.1.0
config file = None
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible-2.4.1.0-py2.7.egg/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]

Configure Ansible for Windows Server Management

Go to the Ansible directory.

cd /etc/ansible

Edit the hosts file with your favorite text editor.

nano hosts

Add the following lines at the bottom of the windows group.

[windows]
server1.domain.local
server1.domain.local

It is necessary to create an encrypted vault containing the access identifiers for the Windows server. For that, we will create a new encrypted yml file. The file name must match the host group to which it should apply. In our case, the created group is called windows, so the file will be windows.yml.

mkdir group_vars
cd group_vars
ansible-vault create windows.yml

In your yml file, add the following parameters.

ansible_ssh_user: _your_ssh_user_
ansible_ssh_pass: _your_ssh_pass_
ansible_ssh_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore

Configure the Windows Server

A PowerShell script is available to automatically configure your machine. This script will automatically configure WinRM (Windows Remote Management) and open the firewall.

Download the PowerShell script from Github.

Modify the execution rules of Powershell scripts to allow the execution of the script.

Set-ExecutionPolicy RemoteSigned

Execute the script.

./ConfigureRemotingForAnsible.ps1

Your Windows Server is now ready for remote management with Ansible.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install BookStack on Debian 9

Next Post

Installing Sponge and Minecraft Forge on Debian 9

Next Post

Installing Sponge and Minecraft Forge on Debian 9

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet