Running a "postimage" script with custom policy trigger

Not applicable

Hello all.

I'm just trying to figure out the best way to setup a postimage routine that installs a few things like sophos and other packages which install best on a live OS.

Right now, I have a policy that checks for "any" and the scope is set to a smart group of computers that don't have certain software (that gets installed postimage). That works, but I'd rather do it by calling a policy via a manual trigger.

"sudo jamf policy -trigger postimage -verbose" works from the command line.

My first attempt to automate it was to have a launchD in /Library/LaunchDaemon that calls the Jamf command at startup (actually it calls a script) and then deletes itself. That does work when manually loaded, but the launchD does not seem to run when I install it from a .dmg during the casper imaging process. "launchctl list" shows it loaded, but it does not work until after I run "launchctl load -w /Library/LaunchDaemons/com.domain.postimage".

Anyway, does someone have a good idea as to a better way of calling the jamf manual policy after the OS boots the first time?

Thanks!
Aaron

7 REPLIES 7

Bukira
Contributor

Hi Aaron

Simple, I do this myself

Step 1, create a shell script that runs the jamf command to check for policys with a custom trigger called ReImage, save and called reimage.sh and add to Casper admin, set the script to run At Reboot and add it to all your configurations.

Step 2, create all your policys in the jss that you want to run post image, name them
1.1.......
1.2......
1.3....
So that they get run in order, set them to the custom trigger ReImage, set to ongoing and scope to all computers. Add them to a category called Post Image.

the Mac then images, reboots, install the adobe cs suite, binds to AD, OD and then runs the reimage.sh script and does all the post image policies.

Cheers

Criss

Sent from my iPad

rmanly
Contributor III

Agreed ;)

$ 0.02

Ryan M. Manly
Glenbrook High Schools

tlarkin
Honored Contributor

I use a post image script with manual trigger policies and then code them in accordingly. So, I have a section in my script that would look like this:

/usr/sbin/jamf policy -trigger mypolicy1

/usr/sbin/jamf policy -trigger mypolicy2

/usr/sbin/jamf policy -trigger mypolicy3

so forth

ernstcs
Contributor III

Oh, and the 'install package at reboot' feature in 7.3 helps eliminate some of your post image scripts with manual triggers. =)

Craig Ernst
UW-Eau Claire
(715) 836-3639

On Jul 12, 2010, at 4:39 PM, Thomas Larkin <tlarki at kckps.org<mailto:tlarki at kckps.org>> wrote:

I use a post image script with manual trigger policies and then code them in accordingly. So, I have a section in my script that would look like this:

/usr/sbin/jamf policy -trigger mypolicy1

/usr/sbin/jamf policy -trigger mypolicy2

/usr/sbin/jamf policy -trigger mypolicy3

so forth

jarednichols
Honored Contributor

Damn those Jamf people building in things that make us look like wizards… Dummy receipts become extension attributes, custom triggered first reboot scripts for pesky software installs become a built-in option…

How am I supposed to look like a miracle worker?!?!?!

;)
--
Jared F. Nichols
Desktop Engineer, Client Services
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436

Bukira
Contributor

Dont tell anyone :-)

Criss Myers
Senior Customer Support Analyst (Mac Services)
iPhone / iPad Developer
Apple Certified Technical Coordinator v10.5
LIS Development Team
Adelphi Building AB28
University of Central Lancashire
Preston PR1 2HE
Ex 5054
01772 895054

bentoms
Release Candidate Programs Tester

Yep..
Can we please remove my bosses subscription to this list?

Ben Toms
IT Support Analyst GREY Group
The Johnson Building, 77 Hatton Garden, London, EC1N 8JS
T: +44 (0) 20-3037-3819 |
Main: +44 (0) 20 3037 3000 | IT Helpdesk: +44 (0) 20 3037 3883