Closed ecanault closed 2 months ago
computer groups has been refactored to support scenario's where a computer group is smart, assigned to a site and there is no criteria set. as part of pr #180 . this will be included in release v0.0.50. thanks
As said in #terraform-provider-jamfpro
: no need in my opinion to link this to the presence of a site or not.
Let's just mimic the behaviour of a smart group creation when it's done by hand.
Site presence will always be optional from a hcl perspective. To be clear, this change supports both of these scenarios
resource "jamfpro_computer_group" "computer_group_003" {
name = "tf-localtest-smartcomputergroup-with_site-01"
is_smart = true
site {
id = 967
}
}
resource "jamfpro_computer_group" "computer_group_004" {
name = "tf-localtest-smartcomputergroup-shell-01"
is_smart = true
}
The reason for confirming your ask is that i have had to change the customDiff behaviour to not iterate on the presence of the isSmart field in the schema for criteria field existence.
This change has been implemented as part of PR #180 and is part of release v0.0.50. Please test and confirm this functions as desired. thank you for your feedback.
Hi,
I have just tested this new release : great 🙂 !
The creation of smart groups without criteria is working well, thanks. I just noticed the following behaviour when we build the same plan without any modification:
Terraform will perform the following actions:
# jamfpro_computer_group.object["81F2EFA5-6611-4CF0-986E-F75929943566"] will be updated in-place
~ resource "jamfpro_computer_group" "object" {
id = "8"
name = "smcg_all_production"
# (1 unchanged attribute hidden)
~ site {
- id = 25 -> null
+ name = "Production"
}
}
And of course during the apply we have:
jamfpro_computer_group.object["81F2EFA5-6611-4CF0-986E-F75929943566"]: Modifying... [id=8]
jamfpro_computer_group.object["81F2EFA5-6611-4CF0-986E-F75929943566"]: Modifications complete after 0s [id=8]
We can also confirm the modification in Jamf Pro:
Please note this occurs only when modifying the site name, regardless the presence of criterias or not.
This can be an issue if it's the same for configuration profiles (not tested yet) as they will be redistributed to the devices if they are updated by terraform, even if there is no change.
Regards, Emmanuel
An update: plan is not reapplied and therefore smart groups are not modified in Jamf Pro if we use site IDs instead of site names.
Hi there, i've implemented a fix as part of v0.0.51 which i'm hoping will resolve the stating issues. thanks
Hi,
In release 0.0.49 it's not possible to create a smart group using
jamfpro_computer_group
resource if no criteria is set.For example with this
.tf
part:This
.tfvars
extract works:But not this one:
So is it possible to modify this to be able to add smart groups without criterias ?
For example our deployment workflows are based on sites (Setup, Production, Inventory) and the best and easiest way to collect all computers from within a specific site is to build a smartgroup linked on that site, without criteria.
Thanks a lot for your evaluation 🙂 !