Skip to content

Installing

Richard Glaser edited this page Mar 10, 2022 · 38 revisions

Installing

sudo pip3 install jctl
  • On your Jamf Pro server create a Jamf Pro API User
  • Configure: conf-python-jamf
  • Enter hostname, username, and password
  • Test: conf-python-jamf -t
  • You should see something like {'accounts': {'groups': None, 'users': {'user': {'id': '1', 'name': 'james'}}}}

Everything that applies to python-jamf also applies to jctl. Please see the python-jamf wiki for detailed installation and configuration instructions.

Uninstalling

sudo pip3 uninstall jctl

It will look something like this.

sudo pip3 uninstall jctl
Found existing installation: jctl 1.1.13
Uninstalling jctl-1.1.13:
  Would remove:
    /usr/local/bin/jctl
    /usr/local/bin/patch.py
    /usr/local/bin/pkgctl
    /usr/local/lib/python3.10/site-packages/jctl-1.1.13.dist-info/*
Proceed (Y/n)? y
  Successfully uninstalled jctl-1.1.13

Upgrading

Upgrading jctl is easy if you installed it via pip. pip is the Package Installer for Python.

To upgrade jctl run the following command:

sudo pip3 install --upgrade jctl

It will look something like this.

sudo pip3 install --upgrade jctl
Requirement already satisfied: jctl in /opt/anaconda3/lib/python3.8/site-packages (1.1.13)
Collecting jctl
  Downloading jctl-1.1.15-py3-none-any.whl (16 kB)
Requirement already satisfied: python-jamf>=0.6.9 in /opt/anaconda3/lib/python3.8/site-packages (from jctl) (0.7.2)
Requirement already satisfied: requests>=2.24.0 in /opt/anaconda3/lib/python3.8/site-packages (from python-jamf>=0.6.9->jctl) (2.25.1)
Requirement already satisfied: keyring>=23.0.0 in /opt/anaconda3/lib/python3.8/site-packages (from python-jamf>=0.6.9->jctl) (23.2.1)
Requirement already satisfied: importlib-metadata>=3.6 in /opt/anaconda3/lib/python3.8/site-packages (from keyring>=23.0.0->python-jamf>=0.6.9->jctl) (3.10.0)
Requirement already satisfied: zipp>=0.5 in /opt/anaconda3/lib/python3.8/site-packages (from importlib-metadata>=3.6->keyring>=23.0.0->python-jamf>=0.6.9->jctl) (3.4.1)
Requirement already satisfied: idna<3,>=2.5 in /opt/anaconda3/lib/python3.8/site-packages (from requests>=2.24.0->python-jamf>=0.6.9->jctl) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/anaconda3/lib/python3.8/site-packages (from requests>=2.24.0->python-jamf>=0.6.9->jctl) (1.26.4)
Requirement already satisfied: chardet<5,>=3.0.2 in /opt/anaconda3/lib/python3.8/site-packages (from requests>=2.24.0->python-jamf>=0.6.9->jctl) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in /opt/anaconda3/lib/python3.8/site-packages (from requests>=2.24.0->python-jamf>=0.6.9->jctl) (2020.12.5)
Installing collected packages: jctl
  Attempting uninstall: jctl
    Found existing installation: jctl 1.1.13
    Uninstalling jctl-1.1.13:
      Successfully uninstalled jctl-1.1.13
Successfully installed jctl-1.1.15

Version

To display the version of jctl installed, run the following command:

jctl --version

For example, it will look something like this:

jctl --version
jctl 1.1.15
python_jamf 0.7.3 (0.6.9 required)

Custom Preferences

You configure your server, username, and password with conf-python-jamf. If you create or copy the preferences to a different location, you can manually tell jctl to use the custom location with -C.

This will look in the current folder for a file named "localhost.plist" and use the server and username stored in that file. It will use that server and username to look in the Keychain for the password.

jctl -C /path/to/localhost.plist [SUBCOMMAND]

Production & Development Preferences

For example, if you wanted to setup two preferences, one, for a development server and another for your production server you could do the following:

Define Default Preferences

First, you should decide which server you want as default and which server(s) want as a custom preference(s): like development, testing, production, etc., with your jctl setup.

Create Custom Preference with Path

Next, use the -C arguement with conf-python-jamf with path to custom preference location:

Development Server Custom Preference

conf-python-jamf -C /path/to/custom-prefs/my.dev.server.plist

Production Server Custom Preference

conf-python-jamf -C /path/to/custom-prefs/my.prod.server.plist