Skip to content
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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ provider to build your own SimpleMDM infrastructure.Provider's official document

## Know issues

- API current doesnt support Create and Delete for Device Groups
- API currently doesnt support update of "name" attribute for Device Groups
- Custom Profiles/Profiles for Assignment group and Devices can no be updated because of API limitation (they are compared only between plan and state from previous plan), aka adding profile via web will not be considered in next apply.
-app assignemnt is not exactly working as expected because of missing data from API (changes requested already), currently there will be always diff in app assignement.
24 changes: 24 additions & 0 deletions docs/data-sources/customdeclaration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "simplemdm_customdeclaration Data Source - simplemdm"
subcategory: ""
description: |-
Custom Declaration data source can be used together with Device(s) or Device Group(s) to set values or in lifecycle management.
---

# simplemdm_customdeclaration (Data Source)

Custom Declaration data source can be used together with Device(s) or Device Group(s) to set values or in lifecycle management.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) ID of the custom Declaration.

### Read-Only

- `name` (String) Default (global) value of the Attribute.
30 changes: 0 additions & 30 deletions docs/data-sources/devicegroup.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "simplemdm Provider"
subcategory: ""
description: |-
SimpleMDM terraform provider developed by FreeNow.
---
Expand Down
9 changes: 9 additions & 0 deletions docs/resources/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ resource "simplemdm_app" "app" {
}
```

```terraform
resource "simplemdm_app" "app" {
bundle_id = "com.myCompany.MyApp1"
deploy_to = "all" // Default to "none" if not added but possible values are "outdated" and "all"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand All @@ -37,6 +44,8 @@ resource "simplemdm_app" "app" {

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# App can be imported by specifying the app ID.
terraform import simplemdm_app.example 123456
Expand Down
50 changes: 32 additions & 18 deletions docs/resources/assignmentgroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "simplemdm_assignmentgroup Resource - simplemdm"
subcategory: ""
description: |-
Assignment Group resource is used to manage group, you can assign App(s), Custom Profile(s), Device(s), Device Group(s) and set addition details regarding Assignemtn Group.
Assignment Group resource is used to manage group, you can assign App(s), Profile(s), Custom Profile(s), Custom Declaration(s), Device(s) and set addition details regarding Group. In case you dont want to manage device/app assignments use lifecycle. Currently App assignment will always show diff in configuration as API is not providing all needed data (request for API change was already submitted).
---

# simplemdm_assignmentgroup (Resource)

Assignment Group resource is used to manage group, you can assign App(s), Custom Profile(s), Device(s), Device Group(s) and set addition details regarding Assignemtn Group.
Assignment Group resource is used to manage group, you can assign App(s), Profile(s), Custom Profile(s), Custom Declaration(s), Device(s) and set addition details regarding Group. In case you dont want to manage device/app assignments use lifecycle. Currently App assignment will always show diff in configuration as API is not providing all needed data (request for API change was already submitted).

## Example Usage

Expand All @@ -19,15 +19,15 @@ resource "simplemdm_assignmentgroup" "myfirstgroup" {
//auto deploy true or false, default is true
auto_deploy = true
//group type "standard" or "munki", defaults to standard. If this parameter is changed it will destroy/create whole group
group_type = "standard"
install_type = "managed"
apps = [123456]
profiles = [123456, 987654]
groups = [135431, 654321]
devices = [135431, 987654]
profiles_sync = false
apps_push = false
apps_update = false
attributes = {
"testAttribute" = "attributevalue"
}
apps = [{ app_id = 553192, deployment_type = "munki", install_type = "managed" }]
}
```

Expand All @@ -36,29 +36,43 @@ resource "simplemdm_assignmentgroup" "myfirstgroup" {

### Required

- `name` (String) The name of the Assignment Group.
- `name` (String) The name of the Group.

### Optional

- `apps` (Set of String) Optional. List of Apps assigned to this assignment group
- `apps_push` (Boolean) Optional. Set true if you would like to send push Apps command after assignment group creation or changes. Defaults to false.
- `apps_update` (Boolean) Optional. Set true if you would like to send update Apps command after assignment group creation or changes. Defaults to false.
- `auto_deploy` (Boolean) Optional. Whether the Apps should be automatically pushed to device(s) when they join this Assignment Group. Defaults to true
- `devices` (Set of String) Optional. List of Devices assigned to this Assignment Group
- `group_type` (String) Optional. Type of assignment group. Must be one of standard (for MDM app/media deployments) or munki for Munki app deployments. Defaults to standard.
- `groups` (Set of String) Optional. List of Device Groups assigned to this Assignment Group
- `install_type` (String) Optional. The install type for munki assignment groups. Must be one of managed, self_serve, managed_updates or default_installs. This setting has no effect for non-munki (standard) assignment groups. Defaults to managed.
- `profiles` (Set of String) Optional. List of Configuration Profiles (both Custom and predefined Profiles) assigned to this assignment group
- `profiles_sync` (Boolean) Optional. Set true if you would like to send Sync Profiles command after Assignment Group creation or changes. Defaults to false.
- `app_track_location` (Boolean) Optional. If true, it tracks the location of IOS device when the SimpleMDM mobile app is installed. Defaults to true.
- `apps` (Attributes List) Optional. List of Apps assigned to this group (see [below for nested schema](#nestedatt--apps))
- `apps_push` (Boolean) Optional. Installs associated apps to associated devices. A munki catalog refresh or MDM install command will be sent to all associated devices. Defaults to true.
- `apps_update` (Boolean) Optional. Updates associated apps on associated devices. A munki catalog refresh or MDM install command will be sent to all associated devices. Defaults to true
- `attributes` (Map of String) Optional. Map of Attributes and values set for this Group
- `auto_deploy` (Boolean) Optional. Whether the Apps should be automatically pushed to device(s) when they join this Group. Defaults to true
- `devices` (Set of String) Optional. List of Devices assigned to this Group
- `priority` (String) Optional. The priority (0 to 20) of the assignment group. Default to 0
- `profiles` (Set of String) Optional. List of Configuration Profiles (Custom or predefined Profiles and Custom Declarations) assigned to this group
- `profiles_sync` (Boolean) Optional. Set true if you would like to send Sync Profiles command after Group creation or changes. Defaults to true.

### Read-Only

- `id` (String) ID of the Assignment Group in SimpleMDM
- `id` (String) ID of the Group in SimpleMDM

<a id="nestedatt--apps"></a>
### Nested Schema for `apps`

Required:

- `app_id` (String) ID of the Application in SimpleMDM

Optional:

- `deployment_type` (String) Optional. Type of assignment group. Must be one of standard (for MDM app/media deployments) or munki for Munki app deployments. Defaults to standard
- `install_type` (String) Optional. The install type for munki assignment groups. Must be one of managed, self_serve, default_installs or managed_updates. This setting has no effect for non-munki (standard) assignment groups. Defaults to managed.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# Assignment group can be imported by specifying the Assigntment group ID.
terraform import simplemdm_assigntmentgroup.example 123456
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ resource "simplemdm_attribute" "myattribute" {

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# Attribute can be imported by specifying the name of attribute.
terraform import simplemdm_attribute.example myattributename
Expand Down
55 changes: 55 additions & 0 deletions docs/resources/customdeclaration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "simplemdm_customdeclaration Resource - simplemdm"
subcategory: ""
description: |-
Custom Declaration resource can be used to manage Custom Declaration. Can be used together with Device(s) and Group(s) and set addition details regarding Custom Declaration.
---

# simplemdm_customdeclaration (Resource)

Custom Declaration resource can be used to manage Custom Declaration. Can be used together with Device(s) and Group(s) and set addition details regarding Custom Declaration.

## Example Usage

```terraform
resource "simplemdm_customdeclaration" "test" {
name = "testdeclaration"
declaration = jsonencode(jsondecode(file("./testfiles/testdeclaration.json")))
userscope = true
attributesupport = true
escapeattributes = true
declaration_type = "com.apple.configuration.safari.bookmarks"
activation_predicate = ""
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `declaration` (String) Required. Can be string or you can use function 'file' or 'templatefile' to load string from file (see examples folder). Example: declaration = file("./declarations/declaration.json") or declaration = <<-EOT DECLARATION STRING EOT
- `declaration_type` (String) Required. The type of declaration being defined
- `name` (String) Required. A name for the declaration. Example: "My First declaration by terraform"

### Optional

- `activation_predicate` (String) Optional. A predicate format string as Apple's Predicate Programming describes. The activation only installs when the predicate evaluates to true or if it is left blank.
- `attributesupport` (Boolean) Optional. A boolean true or false. When enabled, SimpleMDM will process variables in the uploaded declaration. Defaults to false
- `escapeattributes` (Boolean) Optional. A boolean true or false. When enabled, SimpleMDM escape the values of the custom variables in the uploaded declaration. Defaults to false
- `userscope` (Boolean) Optional. A boolean true or false. If false, deploy as a device declaration instead of a user declaration for macOS devices. Defaults to true.

### Read-Only

- `id` (String) ID of a Custom Declaration in SimpleMDM

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
terraform import simplemdm_customdeclaration.example 12345
```
33 changes: 33 additions & 0 deletions docs/resources/customprofile.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,37 @@ resource "simplemdm_customprofile" "myprofile" {
}
```

```terraform
resource "simplemdm_customprofile" "myprofile" {
name = "My First profiles"
mobileconfig = templatefile("./profiles/profile.mobileconfig", { foo = "bar" })
userscope = true
attributesupport = true
escapeattributes = true
reinstallafterosupdate = false
}
```

```terraform
resource "simplemdm_customprofile" "myprofile" {
name = "My First profiles"
mobileconfig = <<-EOT
<?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>PayloadIdentifier</key>
.....redacted....
</dict>
</plist>
EOT
userscope = true
attributesupport = true
escapeattributes = true
reinstallafterosupdate = false
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand All @@ -46,6 +77,8 @@ resource "simplemdm_customprofile" "myprofile" {

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# Custom profile can be imported by specifying the custom profile ID.
terraform import simplemdm_customprofile.example 123456
Expand Down
9 changes: 5 additions & 4 deletions docs/resources/device.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ resource "simplemdm_device" "firstdevice" {

### Required

- `devicegroup` (String) The ID of Device Group where device will be assigned.
- `name` (String) Required. The SimpleMDM name of the device.

### Optional

- `attributes` (Map of String) The name of the Assignment Group.
- `customprofiles` (Set of String) Optional. List of Custom Configuration Profiles assigned to this Device
- `attributes` (Map of String) Optional. Map of Attributes and values set for this Group
- `devicegroups` (Set of String) The ID of static Group(s) where device will be assigned.
- `devicename` (String) The Device name (localhost name) of the device.
- `profiles` (Set of String) Optional. List of Configuration Profiles assigned to this Device
- `profiles` (Set of String) Optional. List of Configuration Profiles (Custom or predefined Profiles and Custom Declarations) assigned to this device.

### Read-Only

Expand All @@ -50,6 +49,8 @@ resource "simplemdm_device" "firstdevice" {

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# Device can be imported by specifying the device ID.
terraform import simplemdm_device.example 123456
Expand Down
50 changes: 0 additions & 50 deletions docs/resources/devicegroup.md

This file was deleted.

2 changes: 2 additions & 0 deletions docs/resources/script.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ resource "simplemdm_script" "test" {

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# devicegroup can be imported by specifying the numeric identifier.
terraform import simplemdm_script.example 123456
Expand Down
Loading
Loading