terraform-provider-jamfpro
terraform-provider-jamfpro copied to clipboard
Formatting errors for Configuration Profiles
When trying to create a Configuration Profile in Jamf Pro that contains a Certificate payload, I consistently receive plist line count mismatch
errors during planning. In the past these errors have been generated because by default all files within my repo have a blank last line (added by VS Code). Prior to the formatting changes in the jamfpro_macos_configuration_profile_plist
, I was able to mitigate this by wrapping the file object within the resource in a chomp()
function but this no longer works as the line discrepancy is often quite large.
I believe this could be due to the formatting of the profile placing the data
value all on one line rather than my formatted block within the mobile config file.
And just to confirm, this mobileconfig file example uploads and displays in Jamf without error.
profile.tf
resource "time_static" "example_certs" {
triggers = {
profile_path = "example.mobileconfig"
profile_hash = filemd5("example.mobileconfig")
}
}
resource "jamfpro_macos_configuration_profile_plist" "example_certs" {
name = "Example Certs"
payloads = chomp(file(time_static.example_certs.triggers.profile_path))
redeploy_on_update = "Newly Assigned"
distribution_method = "Install Automatically"
user_removable = false
level = "System"
description = <<-EOT
Updated: ${time_static.example_certs.id}
Source Repo: github.com/example_repo
Distributes the Root Cert for Google
EOT
scope {
all_computers = false
all_jss_users = false
}
}
example.mobileconfig
<?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>PayloadDisplayName</key>
<string>Google Example Root CA</string>
<key>PayloadCertificateFileName</key>
<string>GTS_Root_G1.cer</string>
<key>PayloadContent</key>
<data>
MIIFYjCCBEqgAwIBAgIQd70NbNs2+RrqIQ/E8FjTDTANBgkqhkiG9w0BAQsFADBX
MQswCQYDVQQGEwJCRTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTEQMA4GA1UE
CxMHUm9vdCBDQTEbMBkGA1UEAxMSR2xvYmFsU2lnbiBSb290IENBMB4XDTIwMDYx
OTAwMDA0MloXDTI4MDEyODAwMDA0MlowRzELMAkGA1UEBhMCVVMxIjAgBgN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uY3J0MDIGA1UdHwQrMCkwJ6Al
oCOGIWh0dHA6Ly9jcmwucGtpLmdvb2cvZ3NyMS9nc3IxLmNybDA7BgNVHSAENDAy
MAgGBmeBDAECATAIBgZngQwBAgIwDQYLKwYBBAHWeQIFAwIwDQYLKwYBBAHWeQIF
AwMwDQYJKoZIhvcNAQELBQADggEBADSkHrEoo9C0dhemMXoh6dFSPsjbdBZBiLg9
NR3t5P+T4Vxfq7vqfM/b5A3Ri1fyJm9bvhdGaJQ3b2t6yMAYN/olUazsaL+yyEn9
WprKASOshIArAoyZl+tJaox118fessmXn1hIVw41oeQa1v1vg4Fv74zPl6/AhSrw
9U5pCZEt4Wi4wStz6dTZ/CLANx8LZh1J7QJVj2fhMtfTJr9w4z30Z209fOU0iOMy
+qduBmpvvYuR7hZL6Dupszfnw0Skfths18dG9ZKb59UhvmaSGZRVbNQpsg3BZlvi
d0lIKO2d1xozclOzgjXPYovJJIultzkMu34qQb9Sz/yilrbCgj8=
</data>
<key>PayloadDescription</key>
<string></string>
<key>AllowAllAppsAccess</key>
<true />
<key>KeyIsExtractable</key>
<false />
<key>PayloadEnabled</key>
<true />
<key>PayloadIdentifier</key>
<string>e0eda400-195d-4e65-9719-ab6ab33910cf</string>
<key>PayloadOrganization</key>
<string>Example Org</string>
<key>PayloadType</key>
<string>com.apple.security.pkcs1</string>
<key>PayloadUUID</key>
<string>e0eda400-195d-4e65-9719-ab6ab33910cf</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDescription</key>
<string>Distributes the Root Example Certificates</string>
<key>PayloadDisplayName</key>
<string>Example Certs</string>
<key>PayloadEnabled</key>
<true />
<key>PayloadIdentifier</key>
<string>d0fde289-97c3-4d7c-a218-89a70f88c5aa</string>
<key>PayloadOrganization</key>
<string>Example Org</string>
<key>PayloadRemovalDisallowed</key>
<true />
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>d0fde289-97c3-4d7c-a218-89a70f88c5aa</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>