Use case 1 – automating Windows application management

Application management on a Windows machine can be a bit messy since Windows has always lacked a package manager. Chocolatey is one of the solutions that can help fix this issue. The following playbook code makes sure that all the requirements for Chocolatey are installed, then checks for updates to all the application that are installed by Chocolatey. Finally, it installs the latest version of new applications.

It is advised to use this use case with desktop-based Windows hosts rather than for servers. It can be used on servers, however, since most Windows servers now have a graphical interface too.

The following playbook code shows how the preceding actions can be carried out:

---
- name: Application management on Windows hosts
hosts: windows
gather_facts: yes
tasks:
- name: Install latest updated PowerShell for
optimized Chocolatey commands
win_chocolatey:
name: powershell
state: latest

- name: Update Chocolatey to its latest version
win_chocolatey:
name: chocolatey
state: latest

- name: Install a list of applications via Chocolatey
win_chocolatey:
name: "{{ item }}"
state: latest
with_items:
- javaruntime
- flashplayeractivex
- 7zip
- firefox
- googlechrome
- atom
- notepadplusplus
- vlc
- adblockplus-firefox
- adblockplus-chrome
- adobereader
ignore_errors: yes
A more extensive list of applications is available on the Chocolatey packages index web page (https://chocolatey.org/packages).  

This playbook can be used to set up a generic image for specific users who use a number of specific applications on a regular basis.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.178.157