AnsiblePilot — Master Ansible Automation
AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,100 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.
Popular Topics
About Luca Berton
Luca Berton is an Ansible automation expert, author of "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example" published by Apress, and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.
Install Google Chrome in Windows-like systems - Ansible module win_chocolatey — Video Tutorial
How to install the latest Google Chrome Stable on a Windows-like workstation using the chocolatey package manager. Included Playbook in Windows 2019.
What You'll Learn
- How to Install Google Chrome in Windows-like systems with Ansible?
- Ansible module win_chocolatey
- Parameters
- code
- execution
- Conclusion
- Related Articles
Full Tutorial Content
How to Install Google Chrome in Windows-like systems with Ansible?
Today I'm going to reveal how to install the software in a Windows-managed host using Chocolatey Package Manager.
I'm Luca Berton and welcome to today's episode of Ansible Pilot.
Ansible module win_chocolatey
- chocolatey.chocolatey.win_chocolatey
- Manage packages using chocolatey
Chocolatey is the package manager for windows, it has the largest online registry of Windows packages.
At the moment it contains nearly 9000 Community Maintained Packages.
Today we're talking about Ansible module win_chocolatey to automate the software installation process.
The full name is chocolatey.chocolatey.win_chocolatey, which means that is part of the collection distributed by "chocolatey".
It manages packages in Windows using chocolatey. It's the windows correspondent of the ansible package module.
Parameters
- name list-string - the name of the package
- state string - present / latest /absent /downgrade /reinstalled
- version string - specific version
The parameter list is pretty wide but these three are the most important options.
In the "name" parameter you are going to specify the name of the package or a list of packages.
If you would like to install a specific version you could specify it in the "version" parameter.
The state specifies the action that we would like to perform. In our case for install is "present or latest".
## Playbook
Install Google Chrome in Windows-like systems with Ansible Playbook.
code
- install_chrome_windows.yml
```yaml
---
- name: install Google Chrome
hosts: all
become: false
gather_facts: false
tasks:
- name: install packages
chocolatey.chocolatey.win_chocolatey:
name: "googlechrome"
state: present
```
execution
```bash
$ ansible-playbook -i win/inventory install\ chrome/windows.yml
PLAY [install Google Chrome] **********************************************************************
TASK [install packages] ***************************************************************************
changed: [WindowsServer]
PLAY RECAP ****************************************************************************************
WindowsServer : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
```
[code with ❤️ in GitHub](https://github.com/lucab85/ansible-pilot/)
Conclusion
Now you know how to install Google Chrome in Windows-like systems using the chocolatey package manager with Ansible.
Related Articles
- [Ansible Become Guide](/articles/ansible-become-privilege-escalation-complete-guide)
- [Ansible Inventory Guide](/articles/ansible-inventory-complete-guide)
- [Ansible for Windows Guide](/articles/ansible-windows-management-complete-guide)
About This Tutorial
- Author: Luca Berton
- Difficulty: Beginner
- Read time: 2 min
- Category: installation
Read the full written article: Install Google Chrome in Windows-like systems - Ansible module win_chocolatey
Related Video Tutorials
- Install Docker in Windows-like systems - Ansible module win_chocolatey — How to automate the installation of the latest version of Docker Desktop in your Windows-like system with Ansible Playbook and Chocolatey.
- Install Google Chrome in Debian like systems - Ansible module apt_key, apt_repository and apt — How to install the latest Google Chrome Stable on a Debian-like workstation (Debian, Ubuntu, Linux Mint, MX Linux, Deepin, AntiX, PureOS, Kali Linux, Parrot OS, Devuan, Knoppix, AV Linux Linux) verify software using the public GPG key and set up the Google repository. Included Playbook in Ubuntu 20.04 LTS.
- Install Google Chrome on Red Hat Using Ansible — Use Ansible to install Google Chrome on Red Hat. Follow our detailed playbook to add repositories and install Chrome efficiently.
- Install Google Chrome on Suse with Ansible — Learn how to install the latest Google Chrome Stable on SUSE Linux Enterprise Server and openSUSE using Ansible. Follow our step-by-step guide and Playbook for verification and repository setup.
- Ansible win_chocolatey Module: Install Windows Software Packages (Guide) — How to install software on Windows with Ansible win_chocolatey module (chocolatey.chocolatey.win_chocolatey). Manage packages, install, upgrade, remove. Practical YAML examples.
- Add Windows Registry on Windows-like systems - Ansible module win_regedit — Learn how to use Ansible win_regedit module to add, change, or remove Windows registry key-values efficiently and accurately with simple Ansible code examples.