Closed ecanault closed 1 month ago
hi there
try something like this
resource "jamfpro_macos_configuration_profile_plist" "jamfpro_macos_configuration_profile_001" {
name = "tf-localtest-contentcaching-plist-source:jamfpro-${var.version_number}"
description = "An example mobile device configuration profile."
level = "User"
distribution_method = "Install Automatically" // "Make Available in Self Service", "Install Automatically"
payloads = file("${path.module}/support_files/macosconfigurationprofiles/jamf/content-caching.mobileconfig")
user_removable = false
site {
id = 1170
}
scope {
all_computers = true
all_jss_users = true
}
}
and let me know how you get on. i can successfully deploy with site enablement for the config profile with this
Same result with this pretty close resource:
resource "jamfpro_macos_configuration_profile_plist" "jamfpro_macos_configuration_profile_001" {
name = "tf-localtest-contentcaching-plist-source:jamfpro-1"
description = "An example mobile device configuration profile."
level = "User"
distribution_method = "Install Automatically" // "Make Available in Self Service", "Install Automatically"
payloads = file("./cp_disable_softwareupdate.mobileconfig")
user_removable = false
site {
id = 103
}
scope {
all_computers = true
all_jss_users = true
}
}
Don't know if it helps, but here is also the relevant part of my main.tf
:
terraform {
required_providers {
jamfpro = {
source = "deploymenttheory/jamfpro"
version = "~> 0.0.57"
}
}
provider "jamfpro" {
instance_name = var.JAMFPRO_INSTANCE_NAME
username = var.JAMFPRO_USERNAME
password = var.JAMFPRO_PASSWORD
log_level = "none"
log_output_format = "console"
log_console_separator = " "
hide_sensitive_data = true
max_retry_attempts = 5
enable_dynamic_rate_limiting = false
max_concurrent_requests = 5
token_refresh_buffer_period = 10
total_retry_duration = 30
custom_timeout = 30
enable_cookie_jar = true
custom_cookies = {
"jpro-ingress" = "1a5d50ff09889f0e"
}
}
And the content of the .mobileconfig
file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>AllowPreReleaseInstallation</key>
<false/>
<key>AutomaticCheckEnabled</key>
<false/>
<key>AutomaticDownload</key>
<false/>
<key>AutomaticallyInstallAppUpdates</key>
<false/>
<key>AutomaticallyInstallMacOSUpdates</key>
<false/>
<key>CatalogURL</key>
<string/>
<key>ConfigDataInstall</key>
<false/>
<key>CriticalUpdateInstall</key>
<false/>
<key>PayloadDescription</key>
<string/>
<key>PayloadDisplayName</key>
<string>Software Update</string>
<key>PayloadEnabled</key>
<true/>
<key>PayloadIdentifier</key>
<string>C69D345E-DAE2-4C71-B787-8E01430DFEEB</string>
<key>PayloadOrganization</key>
<string>Netopie</string>
<key>PayloadType</key>
<string>com.apple.SoftwareUpdate</string>
<key>PayloadUUID</key>
<string>C69D345E-DAE2-4C71-B787-8E01430DFEEB</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>restrict-software-update-require-admin-to-install</key>
<false/>
</dict>
</array>
<key>PayloadDescription</key>
<string/>
<key>PayloadDisplayName</key>
<string>cp_test_terraform</string>
<key>PayloadEnabled</key>
<true/>
<key>PayloadIdentifier</key>
<string>5ACE1F26-6A50-43A3-AA62-D585FE910227</string>
<key>PayloadOrganization</key>
<string>NETOPIE</string>
<key>PayloadRemovalDisallowed</key>
<true/>
<key>PayloadScope</key>
<string>User</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>5ACE1F26-6A50-43A3-AA62-D585FE910227</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>
this worked for me using your payload
resource "jamfpro_macos_configuration_profile_plist" "jamfpro_macos_configuration_profile_002" {
name = "tf-localtest-cp_test_terraform-plist-source:jamfpro"
description = "An example mobile device configuration profile."
level = "User"
distribution_method = "Install Automatically" // "Make Available in Self Service", "Install Automatically"
payloads = file("${path.module}/support_files/macosconfigurationprofiles/jamf/cp_test_terraform.mobileconfig")
user_removable = false
site {
id = 1170
}
scope {
all_computers = true
all_jss_users = true
}
}
incidentally, the payload doesn't appear to be gui directly but i can update the plist in the .mobileconfig and that triggers state updates. struggling here to recreate your issue
OK now in 0.0.58 with your example.
I still have issues with my own contents, but it's certainely on my side inside the code of my .tf
file.
Thanks!
It seems that there is a small bug with site management : when I add the following in my
.tf
file (obviously site ID 103 exists in my Jamf Pro server):Plan seems to be correct:
But the result of the apply is: