Skip to content

Commit

Permalink
Refactor Jamf Pro configuration profiles and packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ShocOne committed Mar 25, 2024
1 parent 131edcd commit 28036bf
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
36 changes: 18 additions & 18 deletions workload/terraform/jamfpro/macosconfigurationprofiles.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

resource "jamfpro_macos_configuration_profile" "jamfpro_macos_configuration_profile_001" {
name = "tf-ghatest-macosconfigprofile-accessibility-options"
distribution_method = "Install Automatically"
payload = file("${path.module}/support_files/configuration_profiles/accessibility-chara-nosub-test.mobileconfig")
category {
id = -1
}
scope {
all_computers = false
computer_ids = sort([17, 18])
computer_group_ids = sort([53])
jss_user_ids = [4]
jss_user_group_ids = [4]
# resource "jamfpro_macos_configuration_profile" "jamfpro_macos_configuration_profile_001" {
# name = "tf-ghatest-macosconfigprofile-accessibility-options"
# distribution_method = "Install Automatically"
# payload = file("${path.module}/support_files/configuration_profiles/accessibility-chara-nosub-test.mobileconfig")
# category {
# id = -1
# }
# scope {
# all_computers = false
# computer_ids = sort([17, 18])
# computer_group_ids = sort([53])
# jss_user_ids = [4]
# jss_user_group_ids = [4]

exclusions {
department_ids = [27653]
}
}
}
# exclusions {
# department_ids = [27653]
# }
# }
# }
50 changes: 25 additions & 25 deletions workload/terraform/jamfpro/packages.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@

// Define a Jamf Pro Package Resource

resource "jamfpro_package" "jamfpro_package_001" {
name = "tf-ghatest-package-suspiciouspackage"
package_file_path = "support_files/packages/SuspiciousPackage.dmg"
category = "Unknown"
info = "tf package deployment for demonstration"
notes = "This package is used for Terraform provider documentation example."
priority = 10
reboot_required = false
fill_user_template = true
fill_existing_users = true
boot_volume_required = false
allow_uninstalled = false
os_requirements = "macOS 10.15.1, macOS 10.15.7"
install_if_reported_available = false
send_notification = true
}
# resource "jamfpro_package" "jamfpro_package_001" {
# name = "tf-ghatest-package-suspiciouspackage"
# package_file_path = "support_files/packages/SuspiciousPackage.dmg"
# category = "Unknown"
# info = "tf package deployment for demonstration"
# notes = "This package is used for Terraform provider documentation example."
# priority = 10
# reboot_required = false
# fill_user_template = true
# fill_existing_users = true
# boot_volume_required = false
# allow_uninstalled = false
# os_requirements = "macOS 10.15.1, macOS 10.15.7"
# install_if_reported_available = false
# send_notification = true
# }

data "jamfpro_package" "jamfpro_package_001_data" {
id = jamfpro_package.jamfpro_package_001.id
}
# data "jamfpro_package" "jamfpro_package_001_data" {
# id = jamfpro_package.jamfpro_package_001.id
# }

output "jamfpro_package_001_data_id" {
value = data.jamfpro_package.jamfpro_package_001_data.id
}
# output "jamfpro_package_001_data_id" {
# value = data.jamfpro_package.jamfpro_package_001_data.id
# }

output "jamfpro_package_001_data_name" {
value = data.jamfpro_package.jamfpro_package_001_data.name
}
# output "jamfpro_package_001_data_name" {
# value = data.jamfpro_package.jamfpro_package_001_data.name
# }
36 changes: 18 additions & 18 deletions workload/terraform/jamfpro/scripts.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
resource "jamfpro_script" "jamfpro_script_001" {
name = "tf-ghatest-correct-application-permissions-v1.0"
script_contents = file("${path.module}/support_files/scripts/Correct Application Permissions.sh")
os_requirements = "13"
priority = "BEFORE"
info = "Adds target user or group to specified group membership, or removes said membership."
notes = "Jamf Pro script parameters: 4 -> 7"
parameter4 = "Google Chrome" // targetApplication
}
# resource "jamfpro_script" "jamfpro_script_001" {
# name = "tf-ghatest-correct-application-permissions-v1.0"
# script_contents = file("${path.module}/support_files/scripts/Correct Application Permissions.sh")
# os_requirements = "13"
# priority = "BEFORE"
# info = "Adds target user or group to specified group membership, or removes said membership."
# notes = "Jamf Pro script parameters: 4 -> 7"
# parameter4 = "Google Chrome" // targetApplication
# }

data "jamfpro_script" "jamfpro_script_001_data" {
id = jamfpro_script.jamfpro_script_001.id
}
# data "jamfpro_script" "jamfpro_script_001_data" {
# id = jamfpro_script.jamfpro_script_001.id
# }

output "jamfpro_script_001_data_id" {
value = data.jamfpro_script.jamfpro_script_001_data.id
}
# output "jamfpro_script_001_data_id" {
# value = data.jamfpro_script.jamfpro_script_001_data.id
# }

output "jamfpro_script_001_data_name" {
value = data.jamfpro_script.jamfpro_script_001_data.name
}
# output "jamfpro_script_001_data_name" {
# value = data.jamfpro_script.jamfpro_script_001_data.name
# }

# resource "jamfpro_script" "jamfpro_script_002" {
# name = "tf-ghatest-encrypt-apfs-volume-v5.0.1"
Expand Down

0 comments on commit 28036bf

Please sign in to comment.