Giter Site home page Giter Site logo

ansible-role-chocolatey_package_localize's Introduction

ansible-role-chocolatey_package_localize

Ansible role to localize chocolatey packages for Windows.

With the defaults this role will:

  • Create c:\repo directory
  • Set up SMB share giving access to Administrator user
  • Download list of chocolately packages (.nupkg) locally

The following can also be configured as part of the role but require some chocolate_packages with url variable to be set:

  • For packages that depends on external binaries, you can provide url to download and repackage for local deployments.
    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 provided as an example only. Do not use this in production. You can fork/clone and add/remove steps for your environment based on your organization's security and operational requirements.

Requirements

No special requirements. This role will run against a Windows server.

Role Variables

Mandatory Variables

None, this role will run with the default options set.

Default Variables

  • chocolatey_repo_folder: Directory to create and to store local packages.
  • chocolatey_internalize_packages: whether to download binaries and repackage (default: true).
  • chocolatey_setup_shared_repo: whether to setup a simple to use a repository for the clients (default: true).
  • chocolatey_share_name: The name of the SBM share for the repo (default: repo).
  • chocolatey_share_description: The description of the SBM share for the repo (default: nuget repo).
  • chocolatey_share_full_access: The group/user name to give full access to SMB share for the repo (default: Administrator).
  • chocolatey_share_read_access: The group/user name to give read access to SMB share for the repo (default: Administrator).
  • chocolatey_packages: The list of packages in 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

ansible-role-chocolatey_package_localize's People

Contributors

oatakan avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.