-
Notifications
You must be signed in to change notification settings - Fork 4
Generating the Installer Script
In this repository's parent directory, you'll find generator.py
. This script will process your CSV of printer queues (See: Creating Printer Queue Definitions) and output a usable printer-installer.py
script, which you will upload to your JSS.
- Clone the repository
cd
into its parent directory - Execute
python generator.py /path/to/config.json /path/to/printers.csv
, substituting the actual path to your printer CSV file
Note: The paths to your config.json file and printer inventory CSV file are required arguments.
The CSV will be read in, converted to a JSON document, saved as a JSON file to the output/
directory for reference, then injected into a template Python script. This results in printer-installer.py
being created (or updated) in the output/
directory.
Note: If you run the generated
printer-installer.py
locally to test, make sure you do so via sudo. The call to thejamf
binary therein requires root privileges.
While you can filter the list of printers displayed to the user, you may wish to completely exclude a group of printers from being included in the installer script. This is useful if you generate your printer inventory CSV from some external process that includes all printers on your print server, including "restricted" devices not generally available to any end user.
Simply create a plaintext file that lists the DisplayName attribute – one per line – of printers you wish to exclude:
CEOsPersonalPrinter
FinanceDeptCheckPrinter
ExpensiveFoilEmbossedLetterheadPrinter
Pass the path of your exclusions file as a secondary argument when executing generator.py
:
python generator.py /path/to/config.json /path/to/printers.csv /path/to/exclusions.txt