Skip to content

Commit 24812f6

Browse files
authored
Merge pull request #278 from microsoft/release/5.1.0
Release/5.1.0
2 parents 8dde4a5 + d67f217 commit 24812f6

20 files changed

+1237
-232
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ tags
2626
*/tags
2727
.chef
2828
results
29+
*.bak
2930

3031
# You should check in your Gemfile.lock in applications, and not in gems
3132
external_tests/*.lock

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,47 @@
11
# Changelog
22

3+
## [5.1.0] - 2023-06-27
4+
5+
### Fixed
6+
7+
- Fixed issues with ARD not working on macOS Monterey.
8+
- Ensured that CLT demand file always exists before we query the SWU catalog.
9+
10+
### Added
11+
12+
- Added additional functionality to the [remote_management](resources/remote_management.rb) resource.
13+
- You can now specify the users to whose privileges will be configured.
14+
- You can now specify the privileges to bestow upon the given users.
15+
- You can now set the computer info fields; this is helpful for stratifying computers within ARD.
16+
317
## [5.0.6] - 2023-06-23
418

519
### Fixed
6-
- Fixed permissions issue with the `macos::command_line_tools` resource.
20+
21+
- Fixed permissions issue with the `macos::command_line_tools` resource.
722

823
## [5.0.5] - 2023-06-20
924

1025
### Fixed
26+
1127
- Updated `command_line_tools` so that machines are able to install previously installed command line tools if they were wiped from a major macOS upgrade.
1228

1329
## [5.0.4] - 2023-01-31
1430

1531
### Added
32+
1633
- Added key `LastPrivacyBundleVersion` to `macos_user` resource to allow for dimissing more Welcome screens in macOS 12.6.3
1734

1835
## [5.0.3] - 2022-11-16
1936

2037
### Fixed
38+
2139
- Xcode resource verifies that a `xcodebuild` command can be ran when checking to see if Xcode is installed, in addition to verifying that Xcode.app exists.
2240

2341
## [5.0.2] - 2022-09-08
2442

2543
### Added
44+
2645
- Xcode resource logs the Xcode version to install computed from the provided version.
2746
- Xcode library supports calling the `version` property more than once by not changing the stored data type.
2847

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ Chef resources and recipes for managing and provisioning macOS.
1010

1111
## Officially Supported Chef Versions
1212

13-
- Chef 16
1413
- Chef 17
14+
- Chef 18
1515

1616
## Officially Supported OS Versions
1717

18-
- macOS 10.14 Mojave
19-
- macOS 10.15 Catalina
2018
- macOS 11 Big Sur
2119
- macOS 12 Monterey
2220

azure-pipelines.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ jobs:
4747
- template: test-kitchen.yml@templates
4848
parameters:
4949
platforms:
50-
- mojave-chef17
51-
- catalina-chef17
52-
- big-sur-chef17
53-
- monterey-chef17
50+
- big-sur-x86
51+
- monterey-x86
52+
# - ventura-arm
5453
suites:
5554
- default
5655
- software-updates
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
# command_line_tools
22

3-
The [``command_line_tools``](https://github.com/Microsoft/macos-cookbook/blob/master/resources/command_line_tools.rb) resource manages the state of a single Xcode Command Line Tools installation, and will only install the latest version for the current running version of macOS.
3+
The [`command_line_tools`](https://github.com/Microsoft/macos-cookbook/blob/master/resources/command_line_tools.rb) resource manages the state of a single Xcode Command Line Tools installation, and will only install the latest version for the current running version of macOS.
44

55
## Syntax
66

77
```ruby
8-
command_line_tools 'name' do
8+
command_line_tools 'name' do # defaults to '' if not specified
99
compile_time true, false # defaults to false if not specified
1010
action Symbol # defaults to :install if not specified
1111
end
1212
```
1313

1414
where:
1515

16-
- ``command_line_tools`` is the resource.
17-
- ``name`` is the name given to the resource block.
18-
- ``action`` identifies which steps the chef-client will take to bring the node into the desired state.
19-
- ``compile_time`` is the property available to this resource.
16+
- `command_line_tools` is the resource.
17+
- `name` is the name given to the resource block, which is optional.
18+
- `action` identifies which steps the chef-client will take to bring the node into the desired state.
19+
- `compile_time` is the property available to this resource.
2020

2121
## Actions
2222

23-
The ``command_line_tools`` resource has the following actions:
23+
The `command_line_tools` resource has the following actions:
2424

25-
``:install``
25+
`:install`
2626

27-
      Default. Install Command Line Tools from Apple. Takes no action if any version has previously been installed on the system.
27+
      Default. Install Command Line Tools from Apple. Takes no action if any version has previously been installed on the system, unless that version has been deleted, in which case it will attempt to install that version again.
2828

29-
``:upgrade``
29+
`:upgrade`
3030

31-
      Check for an updated version of Command Line Tools and install them if available.
31+
      Check for an updated version of Command Line Tools and install them, unless the latest version is already installed.
3232

33-
``:nothing``
33+
`:nothing`
3434

3535
      This resource block does not act unless notified by another resource to take action. Once notified, this resource block either runs immediately or is queued up to run at the end of the Chef Client run.
3636

3737
## Properties
3838

39-
``compile_time``
39+
`compile_time`
4040

41-
      **Ruby Type:** true, false | **Default Value:** ``false``
41+
      **Ruby Type:** true, false | **Default Value:** `false`
4242

4343
      Install the Xcode Command Line Tools at compile time.
4444

@@ -47,7 +47,7 @@ The ``command_line_tools`` resource has the following actions:
4747
### Install Xcode Command Line Tools
4848

4949
```ruby
50-
command_line_tools 'random_name'
50+
command_line_tools
5151
```
5252

5353
If running **macOS 10.14.2**, it will install **'Command Line Tools (macOS Mojave version 10.14) for Xcode-10.14'** via the `softwareupdate` utility.
Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,63 @@
11
remote_management
22
===
33

4-
Use the **remote_management** resource to manage the "Remote Management" settings, found in System
5-
Preferences > Sharing > Remote Management. Under the hood, the [**remote_management**](https://github.com/Microsoft/macos-cookbook/blob/master/resources/remote_management.rb) resource
6-
executes the `kickstart` command, located in ARDAgent.app (one of macOS' "core services").
4+
Use the **remote_management** resource to manage the "Remote Management" settings in System Preferences > Sharing > Remote Management. Under the hood, the [remote_management](../resources/remote_management.rb) resource utilizes the [kickstart](https://ss64.com/osx/kickstart.html) script.
75

86
Syntax
97
------
108

11-
The **remote_management** resource block declares a basic description of the command configuration
12-
and an action executed. For example:
13-
149
```ruby
15-
remote_management 'enable remote management' do
16-
action :enable
10+
remote_management 'configure remote management' do
11+
users [String, Array]
12+
privileges [String, Array]
13+
computer_info [String, Array]
1714
end
1815
```
1916

20-
where
21-
22-
- `:enable` activates remote management and configures full privileges for all users on the system.
23-
- `:disable` deactivates the remote management agent and prevents it from activating at boot time.
24-
25-
The default `:enable` action is equivalent to configuring the following
26-
**System Preferences > Sharing** settings:
27-
28-
![Sharing Preferences](sharing_preferences.png)
29-
30-
The full syntax for all of the properties that are available to the **remote_management**
31-
resource is:
32-
33-
```ruby
34-
remote_management 'description' do
35-
action Symbol # defaults to [:enable] if not specified
36-
end
37-
```
17+
Properties
18+
-------
3819

20+
* `users`
21+
* **Description:** the user(s) whoose ARD privileges will be configured.
22+
* **Usage:** a single user can be specified in the form of a string, or multiple users can be specified as an array of strings. Specifying 'all' is a special case; all local users will be configured.
23+
* **Default:** `'all'`
24+
* Privileges will be configured for all local users.
25+
* **Constraints:** specified users must exist on the system.
26+
<br></br>
27+
28+
* `privileges`
29+
* **Description:** the desired privileges to bestow upon the given user(s).
30+
**Usage:** a single privilege can be specified in the form of a string, or multiple privileges can be specified as an array of strings.
31+
* **Default:** `'all'`
32+
* **Constraints:** the list of optional privileges bellow
33+
* `all` → grant all privileges (default)
34+
* `none` → disable all privileges for the specified user
35+
* `DeleteFiles` → delete files
36+
* `TextMessages` → send a text message
37+
* `OpenQuitApp` → open and quit applications
38+
* `GenerateReport` → generate reports
39+
* `RestartShutDown` → restart *and/or* shutdown
40+
* `SendFile` → send *and/or* retrieve files
41+
* `ChangeSetting` → change system settings
42+
* `ShowObserve` → show the client when being observed or controlled
43+
* `ControlObserve` → control AND observe (unless ObserveOnly is also specified)
44+
* `ObserveOnly` → modify ControlObserve option to allow Observe mode only
45+
<br></br>
46+
47+
* `computer_info`
48+
* **Description:** Info fields; helpful for stratifying computers in the ARD client app.
49+
* **Usage** a single info field can be added as a string, or multiple info fields can be added as an array of strings.
50+
* **Default:** `[]`
51+
* No info fields will be added.
52+
* **Constraints:** there is a maximum of four info fields allowed.
53+
3954
Actions
4055
-------
4156

42-
This resource has the following actions:
43-
44-
`:enable`
45-
46-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Activate remote management and configure full privileges for all users on the system.
47-
48-
`:disable`
57+
* `enable`
58+
* **Description:** activate remote management and configure full privileges for all users on the system.
59+
* **GUI Equivalent:** activating with the privileges property set to 'all' is equivalent to the following:
60+
![Sharing Preferences](sharing_preferences.png)
4961

50-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deactivate the remote management agent and prevent it from activating at boot time.
62+
* `disable`
63+
* **Description:** deactivate the remote management agent and prevent it from activating at boot time.

kitchen.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ driver:
77

88
provisioner:
99
product_name: chef
10+
product_version: 18
1011
multiple_converge: 2
1112

1213
verifier:
@@ -19,33 +20,25 @@ verifier:
1920
- test/integration/default
2021

2122
platforms:
22-
- name: mojave-chef17
23+
- name: big-sur-x86
2324
driver:
24-
box: microsoft/macos-mojave
25-
box_version: 10.14.6
26-
provisioner:
27-
product_version: 17
25+
box: microsoft/macos-big-sur
26+
box_version: 11.7.8
2827

29-
- name: catalina-chef17
28+
- name: monterey-x86
3029
driver:
31-
box: microsoft/macos-catalina
32-
box_version: 10.15.7
33-
provisioner:
34-
product_version: 17
30+
box: microsoft/macos-monterey
31+
box_version: 12.6.7
3532

36-
- name: big-sur-chef17
33+
- name: ventura-x86
3734
driver:
38-
box: microsoft/macos-big-sur
39-
box_version: 11.6.5
40-
provisioner:
41-
product_version: 17
35+
box: microsoft/macos-ventura
36+
box_version: 13.4
4237

43-
- name: monterey-chef17
38+
- name: ventura-arm
4439
driver:
45-
box: microsoft/macos-monterey
46-
box_version: 12.6.3
47-
provisioner:
48-
product_version: 17
40+
box: microsoft/macos-ventura-arm
41+
box_version: 13.4.1
4942

5043
suites:
5144
- name: default
@@ -104,7 +97,7 @@ suites:
10497
- recipe[macos_test::command_line_tools]
10598
verifier:
10699
controls:
107-
- command-line-tool-sentinel
100+
- command-line-tool-demand
108101
- xcrun
109102

110103
- name: certificate

libraries/command_line_tools.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ class CommandLineTools
66
attr_reader :version
77

88
def initialize
9-
@version = if installed.empty?
9+
@version = if install_receipts.empty?
1010
latest_from_catalog
1111
else
12-
latest_installed
12+
latest_receipt
1313
end
1414
end
1515

16-
def installed
16+
def install_receipts
1717
packages = Plist.parse_xml(install_history_plist)
1818
packages.select { |package| package['displayName'].match? 'Command Line Tools' }
1919
end
2020

21-
def latest_installed
22-
[installed.last['displayName'], installed.last['displayVersion']].join '-'
21+
def latest_receipt
22+
[install_receipts.last['displayName'], install_receipts.last['displayVersion']].join '-'
2323
end
2424

2525
def latest_from_catalog
@@ -46,17 +46,17 @@ def recommend_version(software_update_package_list)
4646
end
4747

4848
def all_available
49-
softwareupdate_list.select { |product_name| product_name.match /\*.{1,8}Command Line Tools/ }
49+
softwareupdate_list.select { |product_name| product_name.match(/\*.{1,8}Command Line Tools/) }
5050
end
5151

5252
def platform_specific
5353
all_available.select { |product_name| product_name.include? macos_version }
5454
end
5555

5656
def enable_install_on_demand
57-
install_sentinel = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
58-
FileUtils.touch install_sentinel
59-
FileUtils.chown 'root', 'wheel', install_sentinel
57+
install_demand = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
58+
FileUtils.touch install_demand
59+
FileUtils.chown 'root', 'wheel', install_demand
6060
end
6161

6262
def xcode_version(product)

0 commit comments

Comments
 (0)