Stop a policy if one task fails?

zmkaylor
New Contributor III

We have a Self Service policy that uninstalls a troublesome app, installs the latest version, then executes a command. On a small but irritating number of our machine, we seem to have this issue where the wrong DP is used: https://jamfnation.jamfsoftware.com/discussion.html?id=10408 (usually our DMZ DP which isn't accessible inside our network). This causes the app install to fail, but the policy goes on to execute the command. I would prefer the policy stop on the first failure. Is there a way to configure that?

I could cache the app, and only have the policy available to machines that have the app cached but we really needed a quicker solution for this.

Also, when the policy fails Self Service doesn't seem to give any notification of the failure. If you click on "Show Downloads" in Self Service it will show the failure, but our clients didn't know to look for that. Is there a way to make a failure obvious?

Thanks.

3 ACCEPTED SOLUTIONS

mm2270
Legendary Contributor III

Yes, this is a known issue. There is no built in fix for this, but depending on what it is you're looking for, it might be possible to do some error checking in your command or script up front and simply exit if needed, See this thread just as an example, although it doesn't sound like its the same situation you're dealing with. Still, may give you some ideas to chew on.
https://jamfnation.jamfsoftware.com/discussion.html?id=10356

View solution in original post

alexjdale
Valued Contributor III

If you need a quick solution, you could clone the policy and have one that only executes on-network and one that only executes off-network, then have the package install from a specific DP instead of letting it choose automatically?

With time, I would write a control script that has error-trapping logic and runs trigger policies to install the package, so it can detect when it failed and exit out.

Caching the app as you mentioned should be pretty quick, as quick as any other change.

View solution in original post

denmoff
Contributor III
4 REPLIES 4

mm2270
Legendary Contributor III

Yes, this is a known issue. There is no built in fix for this, but depending on what it is you're looking for, it might be possible to do some error checking in your command or script up front and simply exit if needed, See this thread just as an example, although it doesn't sound like its the same situation you're dealing with. Still, may give you some ideas to chew on.
https://jamfnation.jamfsoftware.com/discussion.html?id=10356

alexjdale
Valued Contributor III

If you need a quick solution, you could clone the policy and have one that only executes on-network and one that only executes off-network, then have the package install from a specific DP instead of letting it choose automatically?

With time, I would write a control script that has error-trapping logic and runs trigger policies to install the package, so it can detect when it failed and exit out.

Caching the app as you mentioned should be pretty quick, as quick as any other change.

denmoff
Contributor III

Please see and vote on the Feature Request that i made. https://jamfnation.jamfsoftware.com/featureRequest.html?id=2107

zmkaylor
New Contributor III

@mm2270 - Thanks for the confirmation and the link. I had missed that discussion.
@alexjdale - Thanks. The on and off network policies is how I initially dealt with the problem.
@denmoff - Voted!

To deal with the wrong DP (the DMZ DP) being selected I first, based off of @amanda.wulff's advice here https://jamfnation.jamfsoftware.com/discussion.html?id=10408, removed/rewrote segments that overlapped. But, the same clients were still trying to connect to the DMZ's DP. Then I removed the DMZ DP from the JSS and re-added it. I've tested most of the clients that were having trouble and the issue is resolved for them.

I haven't yet done anything to catch errors in the policy. I'd much prefer JAMF add that feature.