oatakan.chocolatey_package_localize

ansible-role-chocolatey_package_localize

Ansible role for organizing Chocolatey packages on Windows.

With the default settings, this role will:

  • Create a directory at c:\repo
  • Set up an SMB share that gives access to the Administrator user
  • Download Chocolatey package files (.nupkg) to your local system

You can also configure additional settings for the role, but you need to specify some chocolate_packages with a url for them:

  • For packages that need external files to work, you can provide a URL to download and package them for use locally.

Example:

    chocolatey_packages:
      - name: googlechrome
        version: 77.0.3865.120
        url: https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi

Note: This role is only meant for example purposes. Do not use it in a production environment. You can copy or modify it to fit your own organization’s security and operational needs.

Requirements

No special prerequisites. This role works on a Windows server.

Role Variables

Required Variables

None. This role uses default settings.

Default Variables

  • chocolatey_repo_folder: Directory to create for storing local packages.
  • chocolatey_internalize_packages: Indicates if binaries should be downloaded and repackaged (default: true).
  • chocolatey_setup_shared_repo: Indicates if a simple repository should be set up for clients (default: true).
  • chocolatey_share_name: Name of the SMB share for the repository (default: repo).
  • chocolatey_share_description: Description of the SMB share for the repository (default: nuget repo).
  • chocolatey_share_full_access: User or group name to give full access to the SMB share (default: Administrator).
  • chocolatey_share_read_access: User or group name to give read access to the SMB share (default: Administrator).
  • chocolatey_packages: List of packages in a dictionary format:
chocolatey_packages:
  - name: git.install
    version: 2.23.0
  - name: googlechrome
    version: 77.0.3865.120
    url: https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi

Example

Dependencies

None

Example Playbook

- name: localize packages
  hosts: windows_server
  gather_facts: no
  roles:
    - oatakan.chocolatey_package_localize

- name: setup repo and install packages on clients
  hosts: windows_clients
  gather_facts: no
  tasks:
    - name: Add new internal source
      win_chocolatey_source:
        name: internal repo
        state: present
        source: '\\windows_server\repo'
        priority: 1
    
    - name: Install packages
      win_chocolatey:
        name: "{{ item }}"
      loop:
        - git.install
        - googlechrome
      vars:
        ansible_become: yes
        ansible_become_method: runas
        ansible_become_user: '{{ ansible_user }}'
        ansible_become_pass: '{{ ansible_password }}'

License

MIT

Author Information

Orcun Atakan

Informazioni sul progetto

Ansible galaxy role for internalizing Chocolatey packages for Windows.

Installa
ansible-galaxy install oatakan.chocolatey_package_localize
Licenza
mit
Download
474
Proprietario