Install Windows Features and Roles With Ansible for Windows

In this blog post, I will show you how to install Windows Server (2019 and 2016) using Ansible for Windows with a playbook.

Ansible for Windows series

In the manage Windows with Ansible series, I showed you how to get started with Ansible and manage Windows machines using Playbooks and inventories.


The following Ansible playbook will install Windows Deployment Services (WDS) and will restart the server if needed.

- name: "Work With Active Directory Machines"
  hosts: windows
    - name: "Install Windows Deployment Services" 
              - WDS
              - WDS-Deployment
              - WDS-Transport   
            state: present
      register: win_feature
    - name: "Reboot server if needed"
      when: win_feature.reboot_required

Success! You're on the list.

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.