setup-your-mac / Setup-Your-Mac

Setup Your Mac aims to simplify initial device configuration by leveraging swiftDialog and Jamf Pro Policy Custom Events to allow end-users to self-complete Mac setup post-enrollment.
https://snelson.us/sym
MIT License
238 stars 52 forks source link

Add -forceNoRecon flag to run_jamf_trigger function #79

Closed fitzwater-rowan closed 11 months ago

fitzwater-rowan commented 1 year ago

Note: While all requests are welcome, finding available cycles to custom-code a feature we won't use in our production environment is always challenging.

Is your feature request related to a problem? Please describe. Currently we have all our Installomator policies include Maintenance task so inventory is updated after the install. This works great when the policy is ran via Self Service individually. When SYM runs these policies for the initial install; after each app install, recon is ran. This is not ideal due to speed and minor issue due to to frequent recon runs.

Describe the solution you'd like By adding the -forceNoRecon flag (e.g.: eval "${jamfBinary} policy -event ${trigger} -forceNoRecon"), even if the policy has the maintenance task (inventory update) assigned, it will not run during SYM. This allows us to have as single Installomator policy per app that can be used in Self Service while also running a recon at the end of the install.

Describe alternatives you've considered An alternative would be to create separate policies that do NOT include the maintenance task (inventory update). This is not ideal aswe then have two policies that do the same task. One with recon, one without.

dan-snelson commented 1 year ago

Thanks for the FR, @fitzwater-rowan.

I'm wondering if this better suited as a yet-to-be-documented racing-stripe instead of making a change that will impact every SYM admin.

rougegoat commented 1 year ago

@fitzwater-rowan Can you try that forked version I just posted? I added a couple lines to make it so you could have a global value set at the top that appends the -forceNoRecon flag to the policy event triggers. See if that address your issue adequately

dan-snelson commented 12 months ago

Thanks big bunches, @rougegoat!

@fitzwater-rowan: Please test-drive 1.12.0-rc5.

fitzwater-rowan commented 11 months ago

works well!