diff --git a/README.md b/README.md index 662b2dc..cd06396 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ ansible-playbook main.yml --tags "choco,wsl" ## Overriding Defaults -You can override any of the defaults configured in `default.config.yml` by creating a `config.yml` file and setting the overrides in that file. For example, you can customize the installed packages and enable/disable specific tasks with something like: +**NOTE:** You can override any of the defaults configured in `default.config.yml` by creating a `config.yml` file and setting the overrides in that file. For example, you can customize the installed packages and enable/disable specific tasks with something like: ```yaml configure_hostname: true @@ -108,10 +108,17 @@ install_windows_updates: true update_categories: - Critical Updates - Security Updates + - * # Installs all updates choco_installed_packages: - - googlechrome - - git + # installs latest version of the Google Chrome while ignoring the package checksum + - name: googlechrome + state: latest + choco_args: --ignorechecksum + # installs 2.37.1 version of the git + - name: git + version: "2.37.1" + # installs GO, but won't update it - golang install_fonts: true diff --git a/default.config.yml b/default.config.yml index c6c5963..c68a4db 100644 --- a/default.config.yml +++ b/default.config.yml @@ -30,8 +30,14 @@ change_power_plan: true power_plan: "high performance" choco_installed_packages: - - adobereader - - auto-dark-mode + # installs 2019.2.2.20191 version of the adobe reader + - name: adobereader + version: "2022.002.20191" + # installs latest version of the auto-dark-mode while ignoring the package checksum + - name: auto-dark-mode + state: latest + choco_args: --ignorechecksum + # installs awscli, but won't update it - awscli - Firefox - git diff --git a/tasks/chocolatey.yml b/tasks/chocolatey.yml index 7cdaf17..4a849fb 100644 --- a/tasks/chocolatey.yml +++ b/tasks/chocolatey.yml @@ -2,15 +2,11 @@ - name: Ensure configured Chocolatey packages are installed. chocolatey.chocolatey.win_chocolatey: name: "{{ item.name | default(item) }}" - ignore_checksums: true - state: present + state: "{{ item.state | default('present') }}" + version: "{{ item.version | default(omit) }}" + choco_args: "{{ item.choco_args | default(omit) }}" loop: "{{ choco_installed_packages }}" -- name: Upgrade installed Chocolatey packages. - chocolatey.chocolatey.win_chocolatey: - name: all - state: latest - - name: Clean chocolatey and nuget cache. ansible.windows.win_file: path: "{{ item }}"