Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Jamf Pro configuration profiles, packages, and scripts #101

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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