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

Configuration Profile Updates Cause Duplicates on Devices #539

Open
smithjw opened this issue Dec 18, 2024 · 5 comments
Open

Configuration Profile Updates Cause Duplicates on Devices #539

smithjw opened this issue Dec 18, 2024 · 5 comments

Comments

@smithjw
Copy link
Contributor

smithjw commented Dec 18, 2024

It seems there's an issue again that causes duplicate profiles to be pushed to devices when an update is made to one of the keys within the profile. I'm not sure why but the provider is picking up a change with the UUID + Identifier of the profile, pushing the changed profile up to Jamf, then a second version is being deployed to a device.

image

With this duplicate profile on a device, there are now conflicting keys which interfere with desired behaviour.

@smithjw
Copy link
Contributor Author

smithjw commented Dec 18, 2024

Performed a few more tests and found that on initial creation of the profile via Terraform, the apply is succeeding, but the uploaded profile in Jamf has a completely different PayloadUUID than what was in the local mobileconfig file.

When I ran a plan step following the upload, the provider returns No changes. Your infrastructure matches the configuration. (which I'm assuming is expected because of your validation rules). At this point, if I do an api call to the Jamf server to look at the profile, I can see that the UUID/Identifier is different to the local profile.

What seems to happen after this point is that after any changes are made to the resource via TF, the provider then picks up the new keys, but also that the PayloadIdentifier and PayloadUUID differ, and sets them to what is in the local mobileconfig file.

After this point, the PayloadIdentifier and PayloadUUID will not change on the Jamf side of things and remain what is set in the profile locally. I've also tested making changes to the profile via the Jamf UI and the Identifier/UUID also remain the same.

Unsure if this is something to do with the initial upload of the profile, or more likely, some weird Jamf behaviour where it will set its own identifier on initial creation of the profile when it's a brand new resource.

@smithjw
Copy link
Contributor Author

smithjw commented Dec 18, 2024

https://grahamrpugh.com/2020/04/27/managing-profiles-between-multiple-jamf-instances.html

FFS. Seems this is expected behaviour of the Jamf API

@smithjw
Copy link
Contributor Author

smithjw commented Dec 18, 2024

Knowing that Jamf will overwrite UUID/Identifier on the initial Post, could there be any way in the provider to do the following only on creation of a new profile:

  • use post method to deploy profile but dropping any scopes
  • wait for api to confirm the profile has been created
  • immediately perform a put to update the profile (including scopes) which will overwrite the UUID/Identifier to what's in the profile resource.

@ecanault
Copy link

ecanault commented Jan 6, 2025

Knowing that Jamf will overwrite UUID/Identifier on the initial Post, could there be any way in the provider to do the following only on creation of a new profile:

  • use post method to deploy profile but dropping any scopes
  • wait for api to confirm the profile has been created
  • immediately perform a put to update the profile (including scopes) which will overwrite the UUID/Identifier to what's in the profile resource.

Hi @smithjw

Perhaps I don't understand correctly your approach, but unscoping / rescoping the profile will uninstall and reinstall it on computers.

IMHO this is not good if you consider the following examples:

  • For restrictions: the result will impact the user experience as the Dock and the desktop background will disapear / reappear.
  • For WiFi configuration: the Mac will loose network access if it's connected to the WiFi configured in the profile, and (without Ethernet or another available WiFi) it won't be able to reinstall the profile.

Regards,
Emmanuel

@ShocOne
Copy link
Contributor

ShocOne commented Jan 6, 2025

Please see release v0.9.1, the fix in this release will now during config profile updates gets existing payloadUUID's for created plist resources from jamf pro. These are then injected into update requests. Diff suppression remains unchanged.

From my testing, updates now preserve the jamfpro generated payloadUUID's within the config profile server side.

Please test and let me know how you get on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants