deploymenttheory / terraform-provider-jamfpro

Jamf Pro Terraform Provider/Plugin written with the TF Provider SDK v2. Written in go
Mozilla Public License 2.0
28 stars 10 forks source link

`jamfpro_policy` will always have changes in plan/apply #334

Closed smithjw closed 1 month ago

smithjw commented 1 month ago

Running a plan or apply when using the jamfpro_policy resource will always result in changes because of defaults set in Jamf Pro policies under payloads.reboot.

To reproduce:

  1. Create basic policy with the following code
  2. Run a terraform apply
  3. Run a plan or apply
  4. Terraform prompts that there are changes required

Resource code:

resource "jamfpro_policy" "example" {
  name            = "Example"
  enabled         = true

  scope {
    all_computers      = false
    all_jss_users      = false
  }

  payloads {}
}

Changes that will be shown on subsequent plan/apply runs

~ payloads {
  # (1 unchanged attribute hidden)

- reboot {
    - file_vault_2_reboot            = false -> null
    - message                        = "This computer will restart in 5 minutes. Please save anything you are working on and log out by choosing Log Out from the bottom of the Apple menu." -> null
    - minutes_until_reboot           = 5 -> null
    - no_user_logged_in              = "Do not restart" -> null
    - start_reboot_timer_immediately = false -> null
    - startup_disk                   = "Current Startup Disk" -> null
    - user_logged_in                 = "Do not restart" -> null
      # (1 unchanged attribute hidden)
  }
thejoeker12 commented 1 month ago

Fixed in latest release