Skip to main content
Question

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

  • July 30, 2012
  • 4 replies
  • 29 views

Forum|alt.badge.img+12
  • 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

Forum|alt.badge.img+13

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.


Forum|alt.badge.img+12
  • Author
  • Valued Contributor
  • July 30, 2012

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.


Forum|alt.badge.img+31
  • Honored Contributor
  • July 31, 2012

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


Forum|alt.badge.img+12
  • Contributor
  • July 31, 2012

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.