Installing software

Most Linux systems (and indeed other Unix variants) have a native package manager that makes it easy to install a wide variety of software. The chocolatey package manager makes this possible for Windows, and the Ansible win_chocolatey module makes installing software in an unattended manner with Ansible simple. 

You can explore the chocolatey repository and find out more about it at https://chocolatey.org.

For example, if you wanted to roll out Adobe's Acrobat Reader across an estate of Windows machines, you could use either the win_copy or win_get_url modules to distribute the installer, and then the win_package module to install it. However, the following code would perform the same task with less code:

- name: Install Acrobat Reader
  win_chocolatey:
    name: adobereader
    state: present

Discussing the chocolatey packaging system in greater depth is beyond the scope of this book, but it deserves mention because of the ease of package installation and management it brings to the Windows platform.