Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"path": in policy_array as command #21

Closed
amyers22 opened this issue Dec 8, 2022 · 10 comments
Closed

"path": in policy_array as command #21

amyers22 opened this issue Dec 8, 2022 · 10 comments
Assignees
Labels
enhancement New feature or request testing needed On-hold, awaiting feedback waiting info On-hold, waiting information from requestor

Comments

@amyers22
Copy link

amyers22 commented Dec 8, 2022

Currently the "path": in policy_array is configured to look for a file path for verification the listitem completed. Would it be possible to add a command option for verification based on its output?

# Validate the expected path exists
updateScriptLog "SETUP YOUR MAC DIALOG: Testing for \"$path\""
if [[ -f "$path" ]] || [[ -z "$path" ]]; then
dialogUpdateSetupYourMac "listitem: index: $i, status: success, statustext: Installed"
if [[ "$trigger" == "recon" ]]; then
dialogUpdateSetupYourMac "listitem: index: $i, status: success, statustext: Updated"
fi
else
dialogUpdateSetupYourMac "listitem: index: $i, status: fail, statustext: Failed"
jamfProPolicyTriggerFailure="failed"
exitCode="1"
jamfProPolicyPolicyNameFailures+="$listitem \n"
fi

@dan-snelson dan-snelson self-assigned this Dec 8, 2022
@dan-snelson
Copy link
Owner

Thanks for the Feature Request, @amyers22.

Are you able to share a sanitized code sample for testing purposes?

@dan-snelson dan-snelson added waiting info On-hold, waiting information from requestor enhancement New feature or request labels Dec 8, 2022
@dan-snelson
Copy link
Owner

@amyers22: A quick reminder that I’m waiting on you for additional information; please above. Thanks.

@amyers22
Copy link
Author

Not currently. This was more around the ability for the path to be set with something like fdesetup status and if its not on then the policy didnt complete. I know there are file paths to check for FileVault, but this would just be an example of a command output I would want to compare to.

@dan-snelson dan-snelson removed the waiting info On-hold, waiting information from requestor label Dec 13, 2022
@dan-snelson dan-snelson pinned this issue Dec 13, 2022
@dan-snelson
Copy link
Owner

@amyers22 and @mbracco1973:

Please test-drive 1.6.0-rc1.

Screenshot 2022-12-14 at 6 46 29 AM


NOTES:

  • policy_array's path has been replaced with validation
    • validation should not be blank; use None instead (Example here.)
  • 🆕 The confirmPolicyExecution function validates if the policy needs to be executed
  • 🆕 The validatePolicyResult function validates if the policy succeeded
    • Specifying an absolute path for validation to simulate pre-v1.6.0 behavior
    • When specifying a custom value for validation, use None for trigger (Example here and here.)

@dan-snelson dan-snelson added testing needed On-hold, awaiting feedback waiting info On-hold, waiting information from requestor labels Dec 14, 2022
@dan-snelson
Copy link
Owner

@amyers22 and @mbracco1973:

Screenshot 2022-12-14 at 6 41 58 PM

Setup Your Mac (1.6.0-rc3)

Addresses Issue No. 21

  • 🆕 The confirmPolicyExecution function confirms if the policy needs to be executed
  • 🆕 The validatePolicyResult function validates if the policy succeeded
  • 🔥 policy_array's path has been replaced with validation
  • validation must be one of the following values:
    • Absolute path (simulates pre-v1.6.0 behavior, for example: "/Applications/Microsoft Teams.app/Contents/Info.plist")
    • 🆕 Local (for local validation within the Setup Your Mac script; example here and here)
    • 🆕 Remote (for remote validation via a Jamf Pro policies with single-script payloads; example validation script here, with code here and here.)
    • 🆕 None (for triggers which don't require validation, for example: recon as shown here)

@dan-snelson
Copy link
Owner

Setup Your Mac (1.6.0-rc5)

  • Adds both local and remote policy validation for Palo Alto Networks GlobalProtect

Screenshot 2022-12-16 at 5 22 17 AM

@dan-snelson
Copy link
Owner

Setup Your Mac (1.6.0-rc6)

  • Adds local FileVault validation

Screenshot 2022-12-16 at 12 54 06 PM

@amyers22
Copy link
Author

amyers22 commented Jan 5, 2023

I dont deploy Sophos or GlobalProtect, but the FileVault validation works great!

@dan-snelson
Copy link
Owner

Thanks for confirming, @amyers22.

@dan-snelson dan-snelson unpinned this issue Jan 9, 2023
@dan-snelson
Copy link
Owner

Addressed in Setup Your Mac (1.6.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing needed On-hold, awaiting feedback waiting info On-hold, waiting information from requestor
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants