Releases: univ-of-utah-marriott-library-apple/jctl
Releases · univ-of-utah-marriott-library-apple/jctl
1.1.23
[1.1.23] -- 2024-02-05
Full Changelog: 1.1.22...1.1.23
Fixed
- jctl: searchpath ignore JamfRecordInvalidPath errors
1.1.22
Changed
- update_asset_tags.py: renamed jamf to python_jamf
- patch.py: renamed jamf to python_jamf
- setup.py: add py_modules key
1.1.21
pkgctl updates multiple policies/groups at once. Example session:
Reading Jamf data (this could take several minutes, depending on the size of your data)
[1 ] GoogleChrome PatchPolicies Policies Groups
GoogleChrome-119.0.6045.199.pkg 1 1 1
GoogleChrome-120.0.6099.199.pkg
Enter a number, or e[x]it/[q]uit: 1
GoogleChrome
GoogleChrome-119.0.6045.199.pkg
Policies
[1] Install Google Chrome
ComputerGroups
[2] 04 - Needs GoogleChrome-119.0.6045.199.pkg
PatchPolicies
[3] Google Chrome Auto
GoogleChrome-120.0.6099.199.pkg [no patch defined]
Enter one or more numbers, [b]ack, or e[x]it/[q]uit: 1 2 3
Pick the target package:
[1] GoogleChrome-119.0.6045.199.pkg
[2] GoogleChrome-120.0.6099.199.pkg
Enter a number, [b]ack, or e[x]it/[q]uit: 2
Saved policy named Install Google Chrome
Saved computer group named 04 - Needs GoogleChrome-119.0.6045.199.pkg
GoogleChrome-120.0.6099.199.pkg is not defined. Pick a version.
[1] 120.0.6099.199
[2] 120.0.6099.129
[3] 120.0.6099.109
[4] 120.0.6099.71
[5] 120.0.6099.62
[6] 119.0.6045.199
[7] 119.0.6045.159
[8] 119.0.6045.123
[9] 119.0.6045.105
[10] 118.0.5993.117
Enter a number, [b]ack, or e[x]it/[q]uit: 1
Saved patch policiy named Google Chrome Auto
GoogleChrome
GoogleChrome-119.0.6045.199.pkg
GoogleChrome-120.0.6099.199.pkg
Policies
[1] Install Google Chrome
ComputerGroups
[2] 04 - Needs GoogleChrome-119.0.6045.199.pkg
PatchPolicies
[3] Google Chrome Auto
1.1.20
Added
- Added CHANGELOG
- jctl and pkgctl: Load config file in a try block to catch errors
- jctl "-i -" will obtain id's from stdin
Changed
- Requires python-jamf 0.9.0
- jctl import jamf.exceptions
- jctl Rename jamf to python_jamf
- jctl --create can now take a name or json
- jctl Changed how -update args are processed
- jctl Changed how path is printed using json
- jctl Changed where the hostname is confirmed
- jctl Split main function into multiple functions for clarity
- jctl Sped up deleting records
1.1.19
jctl
- Added ability to create new records with json.
- Improved error handling, exits, and printing to STDERR.
- Created new classes that deals with different output formats and simplified the output code.
pkgctl
- Added ability to define packages for to patch management versions while promoting packages.
- Simplified by breaking up long methods into multiple methods.
- Fixed bugs.
1.1.18
1.1.17
- jctl: Changed the json output so it's much easier to parse (with something like jq)
- jctl: Non-json output prints record name first when printing paths
- jctl: Added --print-id (when you need to capture the id of a record to use in another command)
- jctl: Added --debug
- jctl:
-s
now can do!=~
- jctl:
-s
~=
is deprecated, switching it to=~
- pre-commit updated to 4.3.0
- GitHub action updated action names
Example of the new features.
Getting the ID of the Zoom patch software title using jq
:
zoomid=`jctl patchsoftwaretitles -r "Zoom Client for Meetings" -p id -j | jq '.[].id | .[] | tonumber'`
Getting the ID of the Zoom patch software title using --print_id:
zoomid=`jctl patchsoftwaretitles -r "Zoom Client for Meetings" -I`
Using the ID
jctl packages -c "Zoom-5.11.11 (10514).pkg"
jctl patchpolicies -c "Zoom 1" $zoomid "5.11.11 (10514)"
Formatting the json output with jq
:
jctl computergroups -i 2 -j -l | jq
[
{
"id": "2",
"name": "All Managed Servers",
"is_smart": "true",
"site": {
"id": "-1",
"name": "None"
},
"criteria": {
"size": "2",
"criterion": [
{
"name": "Operating System",
"priority": "0",
"and_or": "and",
"search_type": "like",
"value": "server",
"opening_paren": "false",
"closing_paren": "false"
},
{
"name": "Application Title",
"priority": "1",
"and_or": "or",
"search_type": "is",
"value": "Server.app",
"opening_paren": "false",
"closing_paren": "false"
}
]
},
"computers": {
"size": "0"
}
}
]
Here's what it looks like when you specify paths.
jctl policies -n "Install Zoom" -p package_configuration -p general/name -j | jq
[
{
"package_configuration": {
"packages": {
"size": "2",
"package": [
{
"id": "1",
"name": "Zoom-5.11.11 (10514).pkg",
"action": "Install",
"fut": "false",
"feu": "false"
}
]
}
},
"general/name": "Install Zoom"
}
]
Non-json output shows the record name first (the output is still generated by pprint):
jctl computergroups -i 2 -l
{'All Managed Servers': {'computers': {'size': '0'},
'criteria': {'criterion': [{'and_or': 'and',
'closing_paren': 'false',
'name': 'Operating System',
'opening_paren': 'false',
'priority': '0',
'search_type': 'like',
'value': 'server'},
{'and_or': 'or',
'closing_paren': 'false',
'name': 'Application '
'Title',
'opening_paren': 'false',
'priority': '1',
'search_type': 'is',
'value': 'Server.app'}],
'size': '2'},
'id': '2',
'is_smart': 'true',
'name': 'All Managed Servers',
'site': {'id': '-1', 'name': 'None'}}}
Showing the record name first is very helpful when printing paths:
jctl computergroups -p is_smart
{'All Managed Clients': {'is_smart': 'true'}}
{'All Managed Servers': {'is_smart': 'true'}}
Count: 2
Comparing =~
with !=~
:
jctl computergroups -s name=~Cl
All Managed Clients
jctl computergroups -s name!=~Cl
All Managed Servers
Debugging output (yes, this shows the bearer token for my localhost server):
jctl computergroups --debug
2022-10-02 16:55:36,447: DEBUG: __main__ - main(): Warning, debugging output may contain passwords, tokens, or other sensitive information!
2022-10-02 16:55:36,447: DEBUG: __main__ - main(): args: Namespace(record='computergroups', create=None, update=None, delete=False, sub_command=None, id=None, name=None, regex=None, searchpath=None, print_id=False, long=False, path=None, json=False, quiet_as_a_mouse=False, config=None, version=False, use_the_force_luke=False, andele_andele=False, debug=True)
2022-10-02 16:55:36,494: DEBUG: jamf.api.API - _submit_request(): post: http://localhost/api/v1/auth/keep-alive
2022-10-02 16:55:36,759: DEBUG: jamf.api.API - _submit_request(): response.text: {
"token" : "eyJhbGciOiJIUzI1NiJ9.eyJhdXRoZW50aWNhdGVkLWFwcCI6IkdFTkVSSUMiLCJhdXRoZW50aWNhdGlvbi10eXBlIjoiSlNTIiwiZ3JvdXBzIjpbXSwic3ViamVjdC10eXBlIjoiSlNTX1VTRVJfSUQiLCJ0b2tlbi11dWlkIjoiNGE0OGEyNzItZjFiZi00NjkwLWE5YjQtYTU4NjZkNDI2MGJlIiwibGRhcC1zZXJ2ZXItaWQiOi0xLCJzdWIiOiIxIiwiZXhwIjoxNjY0NzUzMTM2fQ.FEOy4rUenvZm3Gc_mrXk3qUnpcFmCtzneKKKs_hW-hk",
"expires" : "2022-10-02T23:25:36.754Z"
}
2022-10-02 16:55:36,832: DEBUG: jamf.api.API - _submit_request(): get: http://localhost/api/v1/jamf-pro-version
2022-10-02 16:55:36,860: DEBUG: jamf.api.API - _submit_request(): response.text: {
"version" : "10.41.0-t1661887915"
}
2022-10-02 16:55:36,861: DEBUG: jamf.api.API - _submit_request(): get: http://localhost/JSSResource/computergroups
2022-10-02 16:55:36,904: DEBUG: jamf.api.API - _submit_request(): response.text: <?xml version="1.0" encoding="UTF-8"?><computer_groups><size>2</size><computer_group><id>1</id><name>All Managed Clients</name><is_smart>true</is_smart></computer_group><computer_group><id>2</id><name>All Managed Servers</name><is_smart>true</is_smart></computer_group></computer_groups>
All Managed Clients
All Managed Servers
Count: 2
2022-10-02 16:55:36,922: DEBUG: jamf.api.API - __del__(): closing session
1.1.16
1.1.15
- Added update_asset_tags.py to project as standalone script
- pkgctl prints warning if it gets an error trying to update data
1.1.14
1.1.14-8465f7a8 Merge pull request #43 from univ-of-utah-marriott-library-apple/pkgct…