Skip to content

Configuring Repositories

GuyKlaassen edited this page Mar 4, 2021 · 5 revisions

Adding File Share Distribution Points

You need to specify your distribution points in the AutoPkg preferences. The JSSImporter will copy packages and scripts to all configured distribution points using the JSS_REPOS key. The value of this key is an array of dictionaries, which means you have to switch tools and use PlistBuddy. Of course, if you want to go all punk rock and edit this by hand like a savage, go for it. At least use vim.

AFP/SMB Distribution Points

AFP and SMB distribution points are easy to configure. Each distribution point is represented by a simple dictionary, with two keys: name, and password. The rest of the information is pulled automatically from the JSS.

  • name is the name of your Distribution Point as specified in the JSS's Management Settings > File Share Distribution Points page.
  • password is the password for the user specified for the "Read/Write" account for this distribution point at Management Settings > File Share Distribution Points > File Sharing > Read/Write Account > Password, NOT the API user's password (they are different, right?).

Example:

# Create our key and array
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS array" ~/Library/Preferences/com.github.autopkg.plist

# For each distribution point, add a dict. This is the first array element, so it is index 0.
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:0 dict" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:0:name string USRepository" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:0:password string abc123" ~/Library/Preferences/com.github.autopkg.plist

# Second distribution point... (Notice the incremented array index.
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:1 dict" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:1:name string MSRepository" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:1:password string abc123" ~/Library/Preferences/com.github.autopkg.plist

# and so on...

So that section of your AutoPkg preferences should look roughly like this:

plutil -convert xml1 -o - ~/Library/Preferences/com.github.autopkg.plist
#...Relevent snippet...
<key>API_PASSWORD</key>
<string>xyzzy</string>
<key>API_USERNAME</key>
<string>apiUser</string>
<key>JSS_REPOS</key>
<array>
    <dict>
        <key>name</key>
        <string>USRepository</string>
        <key>password</key>
        <string>abc123</string>
    </dict>
    <dict>
        <key>name</key>
        <string>MSRepository</string>
        <key>password</key>
        <string>abc123</string>
    </dict>
</array>
<key>JSS_URL</key>
<string>https://test.jss.private:8443</string>
#...

If you really want to, you can explicitly configure the required connection information. Here are the required keys (all values should be of type string):

  • AFP
    • name (optional)
    • URL
    • type: AFP
    • port (optional)
    • share_name
    • username (r/w user)
    • password
  • SMB
    • name (optional)
    • URL
    • domain
    • type: SMB
    • port (optional)
    • share_name
    • username (r/w user)
    • password

Troubleshooting AFP and SMB distribution points

If JSSImporter is having issues mounting your distribution points, the best troubleshooting step you can do is attempt to mount the share in question manually through the Finder or mount command.

Jamf Cloud Distribution Points and other Cloud Distribution Points

Configuring a JCDS, CDP or the legacy JDS is pretty easy too.

There are some caveats to using a JCDS, CDP or JDS. At this time, there is no officially documented way to upload files, or check for their existence on the distribution server. python-jss works around this as best it can, but there is a possibility that a package object can be created, with no package file uploaded due to a glitch at the time of upload.

If things get crazy, or packages seem to be missing, just delete the package object with the web interface and run again.

At this time we recommend the CDP setting for all cloud distribution point types.

Required keys:

  • type: CDP (for for either JCDS, JDS or a separate cloud distribution point)

Example

/usr/libexec/PlistBuddy -c "Add :JSS_REPOS array" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:0 dict" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:0:type string CDP" ~/Library/Preferences/com.github.autopkg.plist

Your JSS_REPOS section should then simply look like this:

<key>JSS_REPOS</key>
<array>
    <dict>
        <key>type</key>
        <string>CDP</string>
    </dict>
</array>

Local Repository

If you prefer to use a Local Repository, use these keys (all values should be of type string):

  • Local
    • type: Local
    • mount_point (use absolute path)
    • share_name (use directory name)

Example

Note: Make sure you change the index number (here=0).

/usr/libexec/PlistBuddy -c "Add :JSS_REPOS array" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:0 dict" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:0:type string Local" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:0:mount_point string /Users/Shared/JAMFdistrib" ~/Library/Preferences/com.github.autopkg.plist
/usr/libexec/PlistBuddy -c "Add :JSS_REPOS:0:share_name string JAMFdistrib" ~/Library/Preferences/com.github.autopkg.plist

Your JSS_REPOS section should then simply look like this:

<key>JSS_REPOS</key>
<array>
    <dict>
        <key>mount_point</key>
        <string>/Users/Shared/JAMFdistrib</string>
        <key>share_name</key>
        <string>JAMFdistrib</string>
        <key>type</key>
        <string>Local</string>
    </dict>
</array>