chocolatey.chocolatey.win_chocolatey – Manage packages using chocolatey¶
Note
This plugin is part of the chocolatey.chocolatey collection (version 1.1.0).
To install it use: ansible-galaxy collection install chocolatey.chocolatey
.
To use it in a playbook, specify: chocolatey.chocolatey.win_chocolatey
.
New in version 0.1.9: of chocolatey.chocolatey
Synopsis¶
Manage packages using Chocolatey.
If Chocolatey is missing from the system, the module will install it.
Requirements¶
The below requirements are needed on the host that executes this module.
chocolatey >= 0.10.5 (will be upgraded if older)
Parameters¶
Notes¶
Note
This module will install or upgrade Chocolatey when needed.
When using verbosity 2 or less (
-vv
) thestdout
output will be restricted. When using verbosity 4 (-vvvv
) thestdout
output will be more verbose. When using verbosity 5 (-vvvvv
) thestdout
output will include debug output.Some packages, like hotfixes or updates need an interactive user logon in order to install. You can use
become
to achieve this, see Become and Windows. Even if you are connecting as local Administrator, usingbecome
to become Administrator will give you an interactive user logon, see examples below.If
become
is unavailable, use win_hotfix to install hotfixes instead of win_chocolatey as win_hotfix avoids usingwusa.exe
which cannot be run withoutbecome
.
See Also¶
See also
- win_chocolatey_config
The official documentation on the win_chocolatey_config module.
- win_chocolatey_facts
The official documentation on the win_chocolatey_facts module.
- win_chocolatey_feature
The official documentation on the win_chocolatey_feature module.
- win_chocolatey_source
The official documentation on the win_chocolatey_source module.
- win_feature
The official documentation on the win_feature module.
- win_hotfix
Use when
become
is unavailable, to avoid usingwusa.exe
.- win_package
The official documentation on the win_package module.
- win_updates
The official documentation on the win_updates module.
- Chocolatey website
More information about the Chocolatey tool.
- Chocolatey packages
An overview of the available Chocolatey packages.
- Become and Windows
Some packages, like hotfixes or updates need an interactive user logon in order to install. You can use
become
to achieve this.
Examples¶
- name: Install git
win_chocolatey:
name: git
state: present
- name: Upgrade installed packages
win_chocolatey:
name: all
state: latest
- name: Install notepadplusplus version 6.6
win_chocolatey:
name: notepadplusplus
version: '6.6'
- name: Install notepadplusplus 32 bit version
win_chocolatey:
name: notepadplusplus
architecture: x86
- name: Install git from specified repository
win_chocolatey:
name: git
source: https://someserver/api/v2/
- name: Install git from a pre configured source (win_chocolatey_source)
win_chocolatey:
name: git
source: internal_repo
- name: Ensure Chocolatey itself is installed and use internal repo as source
win_chocolatey:
name: chocolatey
source: http://someserver/chocolatey
- name: Uninstall git
win_chocolatey:
name: git
state: absent
- name: Install multiple packages
win_chocolatey:
name:
- procexp
- putty
- windirstat
state: present
- name: Install multiple packages sequentially
win_chocolatey:
name: '{{ item }}'
state: present
loop:
- procexp
- putty
- windirstat
- name: Uninstall multiple packages
win_chocolatey:
name:
- procexp
- putty
- windirstat
state: absent
- name: Uninstall a package and dependencies
win_chocolatey:
name: audacity-lame
remove_dependencies: yes
state: absent
- name: Install curl using proxy
win_chocolatey:
name: curl
proxy_url: http://proxy-server:8080/
proxy_username: joe
proxy_password: p@ssw0rd
- name: Install a package that requires 'become'
win_chocolatey:
name: officepro2013
become: yes
become_user: Administrator
become_method: runas
- name: install and pin Notepad++ at 7.6.3
win_chocolatey:
name: notepadplusplus
version: 7.6.3
pinned: yes
state: present
- name: remove all pins for Notepad++ on all versions
win_chocolatey:
name: notepadplusplus
pinned: no
state: present
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Trond Hindenes (@trondhindenes)
Peter Mounce (@petemounce)
Pepe Barbe (@elventear)
Adam Keech (@smadam813)
Pierre Templier (@ptemplier)
Jordan Borean (@jborean93)