Closed kenchan0130 closed 2 months ago
Hi, can you confirm the file source please. Is it local, http or https ? Second, the 500 error is typically when the provider is trying to create the package metadata and it already exists within jamfpro.
As a follow up, reviewing your code example and your PR, i believe lies with the fact you are missing the category id in your hcl. Will close the ticket. Thanks
@ShocOne
can you confirm the file source please. Is it local, http or https ?
It is a local file.
Second, the 500 error is typically when the provider is trying to create the package metadata and it already exists within jamfpro.
I see that it is not a terraform provider issue as I am getting the same error on the Jamf pro UI.
As a follow up, reviewing your code example and your PR, i believe lies with the fact you are missing the category id in your hcl. Will close the ticket. Thanks
According to this provider's source code, the category_id
is optional and default value is -1
.
From this, I recognize that the category_id
is not relevant to this issue.
Here are some working examples from my demo repo
// Example of referencing a package directly within the repository
resource "jamfpro_package" "jamfpro_package_001" {
package_name = "tf-ghatest-package-suspiciouspackage"
package_file_source = "support_files/packages/gha-test-SuspiciousPackage.dmg"
category_id = "-1" // jamfpro_category.jamfpro_category_001.id
info = "tf package deployment for demonstration"
notes = "Uploaded by: terraform-provider-jamfpro plugin."
priority = 10
reboot_required = true
fill_user_template = false
fill_existing_users = false
os_requirements = "macOS 10.15.0"
swu = false
self_heal_notify = false
os_install = false
serial_number = ""
suppress_updates = false
ignore_conflicts = false
suppress_from_dock = false
suppress_eula = false
suppress_registration = false
manifest = ""
manifest_file_name = ""
}
// https://go.microsoft.com/fwlink/?linkid=853070 - company portal
// https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US - firefox
// Example of referencing a package from a https source (with redirects)
resource "jamfpro_package" "jamfpro_package_02" {
package_name = "tf-ghatest-package-httpsourceprovider-test"
package_file_source = "https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US"
category_id = "-1"
info = "tf package deployment for demonstration"
notes = "Uploaded by: terraform-provider-jamfpro plugin."
priority = 10
reboot_required = true
fill_user_template = false
fill_existing_users = false
os_requirements = "macOS 10.15.0"
swu = false
self_heal_notify = false
os_install = false
serial_number = ""
suppress_updates = false
ignore_conflicts = false
suppress_from_dock = false
suppress_eula = false
suppress_registration = false
manifest = ""
manifest_file_name = ""
}
// Example of referencing a package from a https source
resource "jamfpro_package" "jamfpro_package_03" {
package_name = "tf-ghatest-package-httpsourceprovider-companyportal"
package_file_source = "https://go.microsoft.com/fwlink/?linkid=853070"
category_id = "-1"
info = "tf package deployment for demonstration"
notes = "Uploaded by: terraform-provider-jamfpro plugin."
priority = 10
reboot_required = true
fill_user_template = false
fill_existing_users = false
os_requirements = "macOS 10.15.0"
swu = false
self_heal_notify = false
os_install = false
serial_number = ""
suppress_updates = false
ignore_conflicts = false
suppress_from_dock = false
suppress_eula = false
suppress_registration = false
manifest = ""
manifest_file_name = ""
}
for awareness - https://github.com/deploymenttheory/terraform-demo-jamfpro
As mentioned, this is likely a problem specific to my jamf pro instance, so this issue is in the correct state of closed.
Thank you for your support.
Happy to help
Terraform (and Provider) Version
Terraform v1.8.5 on darwin_amd64
provider deploymenttheory/terraform-provider-jamfpro v0.1.5
Affected Resource(s)
jamfpro_package
Terraform Configuration Files
Expected Behavior
Expect files tied to package file to be uploaded.
Actual Behavior
The file cannot be uploaded and an error is obtained.
Steps to Reproduce
terraform apply
terraform apply
againImportant Factoids
After the first executing
terraform apply
, I confirmed the corresponding package from the jamf pro website and found the following error message indicating that the file had not been uploaded.