Skip to content

Commit

Permalink
Merge pull request #6 from snohio/0.5.0---Chocolatey-2-update
Browse files Browse the repository at this point in the history
0.5.0-Updates-to-Chocolatey
  • Loading branch information
snohio authored Oct 24, 2023
2 parents 52a6c44 + 8a3a333 commit 6f167e1
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 21 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This file is used to list changes made in each version of the win_choco cookbook.

## 0.5.0

* Updating and Testing with Chocolatey 2.0
* Removed Edge and added Chrome support (Edge is pretty much defacto standard)
* Updated Inspec tests with new versions

## 0.4.3

* Adding ci.yml and git actions to perform cookstyle and kitchen tests
Expand Down
25 changes: 12 additions & 13 deletions compliance/profiles/win_apps/controls/default.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# copyright: 2021, Mike Butler
# copyright: 2023, Mike Butler

control 'win-app' do
impact 0.7
title 'Windows Applications Installed'

describe chocolatey_package('chocolatey') do
it { should be_installed }
its('version') { should cmp >= '1.2.1' }
its('version') { should cmp >= '2.2.0' }
end

describe chocolatey_package('7zip.install') do
it { should be_installed }
its('version') { should cmp >= '22.1' }
its('version') { should cmp >= '23.1' }
end

describe chocolatey_package('microsoft-edge') do
describe chocolatey_package('GoogleChrome') do
it { should be_installed }
its('version') { should cmp >= '110.0.1587.41' }
its('version') { should cmp >= '118.0.5993.89' }
end
end

Expand All @@ -25,7 +24,7 @@
title 'VS Code Installed'
describe chocolatey_package('vscode') do
it { should be_installed }
its('version') { should cmp >= '1.75.0' }
its('version') { should cmp >= '1.83.0' }
end
end if package('Microsoft Visual Studio Code').installed?

Expand All @@ -34,7 +33,7 @@
title 'Adobe Reader Installed'
describe chocolatey_package('adobereader') do
it { should be_installed }
its('version') { should cmp >= '2022.003.20314' }
its('version') { should cmp >= '2023.006.20360' }
end
end if package('Adobe Acrobat Reader DC MUI').installed?

Expand All @@ -43,7 +42,7 @@
title 'Node JS Installed'
describe chocolatey_package('nodejs') do
it { should be_installed }
its('version') { should cmp >= '19.6.0' }
its('version') { should cmp >= '21.0.0' }
end
end if package('Node.js').installed?

Expand All @@ -52,7 +51,7 @@
title 'OpenJDK Installed'
describe chocolatey_package('openjdk') do
it { should be_installed }
its('version') { should cmp >= '19.0.0' }
its('version') { should cmp >= '21.0.0' }
end
end if ::Dir.exist?('C:\Program Files\OpenJDK')

Expand All @@ -61,14 +60,14 @@
title 'Chef Development Tools'
describe chocolatey_package('chef-workstation') do
it { should be_installed }
its('version') { should cmp >= '23.2.1028' }
its('version') { should cmp >= '23.7.1042' }
end
describe chocolatey_package('vscode') do
it { should be_installed }
its('version') { should cmp >= '1.75.1' }
its('version') { should cmp >= '1.83.0' }
end
describe chocolatey_package('git') do
it { should be_installed }
its('version') { should cmp >= '2.39.1' }
its('version') { should cmp >= '2.42.0' }
end
end if ::Dir.exist?('C:\opscode\chef-workstation')
2 changes: 1 addition & 1 deletion compliance/profiles/win_apps/inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ copyright: Progress
copyright_email: michael.butler@optum.com
license: Apache-2.0
summary: Chocolatey Application Compliance Profile
version: 0.4.3
version: 0.5.0
supports:
platform: windows
8 changes: 4 additions & 4 deletions kitchen.azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ driver:
subscription_id: <%= ENV["AZURE_SUBSCRIPTION_ID"] %>
location: 'East US'
machine_size: 'Standard_D2s_v3'
azure_resource_group_prefix: 'GA-WIN_CHOCO-'
azure_resource_group_prefix: 'ga-win_choco-'
resource_group_tags:
X-TTL: '2'

Expand Down Expand Up @@ -72,9 +72,9 @@ suites:
audit:
reporter: 'cli'
compliance_phase: true
# software:
software:
# adobereader: true
# vscode: true
# tags:
tags:
- chrome
# - chef_developer
# - choco_openjdk
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
maintainer_email 'michael.butler@progress.com'
license 'Apache-2.0'
description 'Installs/Configures win_choco'
version '0.4.3'
version '0.5.0'
chef_version '>= 17.0'
depends 'chocolatey'
16 changes: 14 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Cookbook:: win_choco
# Recipe:: default
#
# Copyright:: 2021, Progress
# Copyright:: 2023, Progress
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -19,12 +19,22 @@
include_profile 'win_choco::win_apps'

include_recipe 'chocolatey::default'

chocolatey_package '7zip.install' do
action :install
end

if tagged?('chrome')
chocolatey_package 'GoogleChrome' do
action :install
end
end

## Only install Microsoft Edge with Choco if it is not already a part of the OS install

chocolatey_package 'microsoft-edge' do
action :install
not_if { node['packages']['Microsoft Edge'] }
end

# This is the Chef Developer Package
Expand All @@ -42,7 +52,9 @@
end
end

# Install Adobe Acrobat Reader if the Attribute [software][adobereader] exists. This can exist in a policyfile, role, or node level.
# Install Adobe Acrobat Reader if the Attribute [software][adobereader] exists.
# This can exist in a policyfile, role, or node level.

if node.exist?('software', 'adobereader')
chocolatey_package 'adobereader' do
action :install
Expand Down

0 comments on commit 6f167e1

Please sign in to comment.