Author: Daniyal Javed


One of the things that we’ve seen gain a lot of traction is native support for Windows inside the Ansible platform. It is hard to find a homogenous IT stack nowadays. For example, you may have a Linux server farm but with Active Directory proving its identity. Your management tools needs to be able to handle Linux, Unix, cloud services and.. Windows

So far our customers have loved Ansible’s simple and agentless automation. Ansible uses SSH to manage Linux machines. For Windows, Ansible uses Powershell remoting. Ansible still runs from a Linux control machine but uses the WinRM python module to talk to the windows host.

This is a demo to showcase the capabilities of Ansible Tower within Windows. I used Ansible Tower to deploy IIS on my Windows machine and which stands up a local website. All of this is done with a simple playbook written in YAML.

In the following video, I will demonstrate exactly how to accomplish this deployment:

The playbook that I used in this demo:

---
- hosts: windows

  tasks:
    - name: Test connection
      win_ping:

# Restart snmp
    - name: Ensuring SNMP is started
      win_service:
        name: snmptrap
        state: started

    - name: Installing IIS
      win_feature:
        name: "Web-Server"
        state: present
        restart: yes
        include_sub_features: yes
        include_management_tools: yes

    - name: Download webpage
      win_get_url:
        url: 'url to your webpage'
        dest: 'C:/inetpub/wwwroot/index.html'
      notify:

      - w3svc reset

    - name: Restarting the web app pool
      win_iis_webapppool:
         name: "DefaultAppPool"
         state: restarted

  handlers:

    - name: w3svc reset
      win_service:
        name: w3svc
        state: restarted

If you have any other questions regarding this demo, please don’t hesitate to reach out and..

//take the first step

Tagged:



//comments