Install Chocolatey With Ansible On Windows Hosts

In this blog post, I will show you how to install Chocolatey on a Windows machine using Ansible and start deploying packages.

About Chocolatey

Chocolatey is a package manager for Windows like apt for Ubuntu and yum for Centos.

Chocolatey is based on PowerShell and the part of it is that the entire installation process is done without using GUI or using screen prompts.

In my case, I will use the following playbook to install chocolatey and chocolatey core extension which is needed to install applications like chrome, git, notepad ++ and many more as you will see in the next few blog posts.

Install Chocolatey Playbook

Below, is the complete playbook to install Chocolatey.

---
- name: "Chocolatey"
  hosts: windows
  tasks:
    - name: Install chocolatey
      win_chocolatey:
          name:
           - chocolatey
           - chocolatey-core.extension
          state: present

To learn more about Ansible for Windows visit the blog series Manage Windows machines with Ansible.


Posted

in

by