Skip to content

Adding a pkg to the jss

Chris Lasell edited this page Sep 24, 2019 · 1 revision

Here's how to create a new Package object in the JSS and upload the .pkg to the Master distribution point. (this assumes you're already connected to the api with appropriate permissions)

local_pkg_path = "/path/to/local.pkg"

# make a new JSS::Package in ruby, to be saved into the JSS
new_pkg = JSS::Package.make name: 'package-name'

new_pkg.filename = 'package-name.pkg'
new_pkg.category = 'some-existing-category'
# ... set more attributes of the package here...

# create the JSS entry for the pkg
new_pkg.save

# Upload the local file to the master dist point.
#   You must provide the password for the read-write connection to the 
#   dist. point (the username comes from the API)
#   The dist. point will be mounted via AFP or SMB, as defined in the JSS, and
#   the pkg uploaded to it.
new_pkg.upload_master_file local_pkg_path, "master_dist_rw_pw" 
Clone this wiki locally