diff --git a/ansible/roles/win_chocolatey/tasks/chocolatey.yml b/ansible/roles/win_chocolatey/tasks/chocolatey.yml index cd2a690..ade23c8 100644 --- a/ansible/roles/win_chocolatey/tasks/chocolatey.yml +++ b/ansible/roles/win_chocolatey/tasks/chocolatey.yml @@ -12,14 +12,23 @@ - name: Community Pacakges tags: community_packages block: - - name: Download base software packages to Chocolatey server. + - name: Create Package folder + win_file: + path: "{{ choco_package_path }}\\{{ package }}" + state: directory + loop: "{{ community_packages }}" + loop_control: + loop_var: package + + - name: Download nupkg to Chocolatey server. win_get_url: - url: "https://community.chocolatey.org/api/v2/package/{{ package.name }}/{{ package.version }}" - dest: "{{ choco_package_path }}\\{{ package.name }}.{{ package.version }}.nupkg" + url: "https://community.chocolatey.org/api/v2/package/{{ package }}" + dest: "{{ choco_package_path }}\\{{ package }}.nupkg" loop: "{{ community_packages }}" loop_control: loop_var: package pause: 10 + rescue: # Fallback to local copies if rate limiting causes failure - name: Local fallback - Get list of local packages vars: diff --git a/ansible/roles/win_chocolatey/vars/main.yml b/ansible/roles/win_chocolatey/vars/main.yml index 2d82713..6afa305 100644 --- a/ansible/roles/win_chocolatey/vars/main.yml +++ b/ansible/roles/win_chocolatey/vars/main.yml @@ -1,4 +1,4 @@ -choco_drive_letter: R +installchoco_drive_letter: R choco_drive_label: Chocolatey opt_chocolatey_server_http_port: 80 opt_chocolatey_server_path: R:\tools\ @@ -8,39 +8,39 @@ community_package_path: /choco/packages/community/ local_repo_source: http://localhost/chocolatey community_packages: - - { name: 'vscode.install', version: '1.83.1' } - - { name: 'vscode', version: '1.83.1' } - - { name: 'chocolatey-windowsupdate.extension', version: '1.0.5' } - - { name: 'KB4019990', version: '1.0.2' } - - { name: 'KB2919442', version: '1.0.20160915' } - - { name: 'KB2919355', version: '1.0.20160915' } - - { name: 'KB2999226', version: '1.0.20181019' } - - { name: 'KB3033929', version: '1.0.5' } - - { name: 'KB3035131', version: '1.0.3' } - - { name: 'firefox', version: '116.0.2' } - - { name: 'microsoft-office-deployment', version: '16.0.17531.20046' } - - { name: 'r.studio', version: '2023.6.1' } - - { name: 'notepadplusplus.install', version: '8.6.2' } - - { name: 'notepadplusplus', version: '8.6.2' } - - { name: 'windirstat', version: '1.1.2.20161210' } - - { name: 'adobereader', version: '2023.3.20269' } - - { name: 'vcredist140', version: '14.38.33135' } - - { name: 'vcredist2015', version: '14.0.24215.20170201' } - - { name: 'python312', version: '3.12.0' } - - { name: 'DotNet4.6', version: '4.6.00081.20150925' } - - { name: 'dotnet4.7.2', version: '4.7.2.20180712' } - - { name: 'chocolatey.server', version: '0.3.0' } - - { name: 'chocolatey-dotnetfx.extension', version: '1.0.1' } - - { name: 'ChocolateyGUI', version: '2.1.1' } - - { name: 'chocolatey-core.extension', version: '1.4.0' } - - { name: 'dotnetfx', version: '4.8.0.20220524' } - - { name: 'Chocolatey', version: '2.2.2' } - - { name: 'chocolatey-compatibility.extension', version: '1.0.0' } - - { name: 'R.Project', version: '4.3.1' } - - { name: 'veeam-agent', version: '6.1.0.350' } - - { name: 'DotNet4.5.2', version: '4.5.2.20140902' } - - { name: 'PowerBI', version: '2.128.952.0' } - - { name: 'GoogleChrome', version: '127.0.6533.89' } - - { name: 'visualstudio2019professional', version: '16.11.39' } - - { name: 'sql-server-2017', version: '14.0.1000' } - - { name: 'sql-server-management-studio', version: '20.2.30' } + - vscode.install + - vscode + - chocolatey-windowsupdate.extension + - KB4019990 + - KB2919442 + - KB2919355 + - KB2999226 + - KB3033929 + - KB3035131 + - firefox + - microsoft-office-deployment + - r.studio + - notepadplusplus.install + - notepadplusplus + - windirstat + - adobereader + - vcredist140 + - vcredist2015 + - python312 + - DotNet4.6 + - dotnet4.7.2 + - chocolatey.server + - chocolatey-dotnetfx.extension + - ChocolateyGUI + - chocolatey-core.extension + - dotnetfx + - Chocolatey + - chocolatey-compatibility.extension + - R.Project + - veeam-agent + - DotNet4.5.2 + - PowerBI + - GoogleChrome + - visualstudio2019professional + - sql-server-2017 + - sql-server-management-studio