ansible.builtin.win_chocolatey_source (v2.9.27) — module

Manages Chocolatey sources

| "added in version" 2.7 of ansible.builtin"

Authors: Jordan Borean (@jborean93)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Used to managed Chocolatey sources configured on the client.

Requires Chocolatey to be already installed on the remote host.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove the default public source
  win_chocolatey_source:
    name: chocolatey
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add new internal source
  win_chocolatey_source:
    name: internal repo
    state: present
    source: http://chocolatey-server/chocolatey
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create HTTP source with credentials
  win_chocolatey_source:
    name: internal repo
    state: present
    source: https://chocolatey-server/chocolatey
    source_username: username
    source_password: password
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Disable Chocolatey source
  win_chocolatey_source:
    name: chocolatey
    state: disabled

Inputs

    
name:
    description:
    - The name of the source to configure.
    required: true

state:
    choices:
    - absent
    - disabled
    - present
    default: present
    description:
    - When C(absent), will remove the source.
    - When C(disabled), will ensure the source exists but is disabled.
    - When C(present), will ensure the source exists and is enabled.

source:
    description:
    - The file/folder/url of the source.
    - Required when I(state) is C(present) or C(disabled) and the source does not already
      exist.

priority:
    description:
    - The priority order of this source compared to other sources, lower is better.
    - All priorities above C(0) will be evaluated first, then zero-based values will be
      evaluated in config file order.
    - Requires Chocolatey >= 0.9.9.9.
    - When creating a new source, this defaults to C(0).
    type: int

admin_only:
    description:
    - Makes the source visible to Administrators only.
    - Requires Chocolatey >= 0.10.8.
    - When creating a new source, this defaults to C(no).
    type: bool

certificate:
    description:
    - The path to a .pfx file to use for X509 authenticated feeds.
    - Requires Chocolatey >= 0.9.10.
    type: str

bypass_proxy:
    description:
    - Bypass the proxy when using this source.
    - Requires Chocolatey >= 0.10.4.
    - When creating a new source, this defaults to C(no).
    type: bool

source_password:
    description:
    - The password for I(source_username).
    - Required if I(source_username) is set.

source_username:
    description:
    - The username used to access I(source).

update_password:
    choices:
    - always
    - on_create
    default: always
    description:
    - When C(always), the module will always set the password and report a change if I(certificate_password)
      or I(source_password) is set.
    - When C(on_create), the module will only set the password if the source is being
      created.

allow_self_service:
    description:
    - Allow the source to be used with self-service
    - Requires Chocolatey >= 0.10.4.
    - When creating a new source, this defaults to C(no).
    type: bool

certificate_password:
    description:
    - The password for I(certificate) if required.
    - Requires Chocolatey >= 0.9.10.

See also