Can you call a Policy during Imaging as opposed to a Package?

tomt
Valued Contributor

Is there any way to have a Configuration use a Policy instead of a Package to install things? It would be nice to just call a Policy (that already exists) since it can contain the scripts and packages together.

An example:
Let's assume each Policy contains one preflight script, one package and one postflight script. Trying to create the right order of operations to run three install Policies while keeping the order of pre and postflight scripts is extremely difficult.

Thanks,
Tom

4 REPLIES 4

rockpapergoat
Contributor III

ahhh… casper limitations.

you could use a payload free pkg that uses its postflight to run policies in whatever order you want using 'jamf policy -id <id number>' or 'jamf policy -trigger <text trigger>.' be aware that if you do this during imaging, your policies/pkgs/scripts need to be written to target the newly imaged volume and not the netboot volume.

it's probably easier to set your policy to run on startup for machines within a scope, which should get you the same results.

tomt
Valued Contributor

Thanks for the reply RPG.

I was trying to avoid needing multiple copies of the same policy with different triggers. I guess I will just dupe the existing ones and change to a Startup trigger.

tlarkin
Honored Contributor

Hey Tom,

Policies can run scripts before or after a policy, that would be your pre and post flight. You can also use manual trigger policies to do whatever a policy can do from the command line. I have used these in post image shell scripts that run at first boot.

Could you give me a more in depth description of what you are trying to accomplish?

Thanks,
Tom

acdesigntech
Contributor II

Hence the reason I'm working standardize all of my packages in .pkg format...

.pkgs can contain pre- and post-flight scripts, pre-install scripts, etc.