-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add clone resource to provider - Added Clone Resource to allow cloning of base images - Added the ability to retry a post_processor_script - Fixed some other issues * fixed linting issue
- Loading branch information
Showing
29 changed files
with
1,434 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,259 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "parallels-desktop_clone_vm Resource - terraform-provider-parallels-desktop" | ||
subcategory: "" | ||
description: |- | ||
Parallels Desktop Clone VM resource | ||
--- | ||
|
||
# parallels-desktop_clone_vm (Resource) | ||
|
||
Parallels Desktop Clone VM resource | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "parallels-desktop_vm" "example" { | ||
host = "https://example.com:8080" | ||
filter { | ||
field_name = "name" | ||
value = "some-machine-name" | ||
case_insensitive = true | ||
} | ||
} | ||
resource "parallels-desktop_clone_vm" "example" { | ||
host = "https://example.com:8080" | ||
name = "example-vm" | ||
owner = "example" | ||
base_vm_id = data.parallels-desktop_vm.example.machines[count.index].id | ||
path = "/some/folder/path" | ||
authenticator { | ||
api_key = "some api key" | ||
} | ||
# this will allow you to fine grain the configuration of the VM | ||
# you can pass any command that is compatible with the prlctl command | ||
# directly to the VM | ||
# Attention: the prlctl will not keep the state, meaning it will always | ||
# execute the action and if you remove it it will not bring the machine | ||
# to the previous state before setting that configuration | ||
prlctl { | ||
operation = "set" | ||
flags = [ | ||
"some-flag" | ||
] | ||
options = [ | ||
{ | ||
flag = "description" | ||
value = "some description" | ||
} | ||
] | ||
} | ||
force_changes = true | ||
# This will contain the configuration for the shared folders | ||
shared_folder { | ||
name = "user_download_folder" | ||
path = "/Users/example/Downloads" | ||
} | ||
# This will contain the configuration for the post processor script | ||
# allowing you to run any command on the VM after it has been deployed | ||
# you can have multiple lines and they will be executed in order | ||
post_processor_script { | ||
// Retry the script 4 times with 10 seconds between each attempt | ||
retry { | ||
attempts = 4 | ||
wait_between_attempts = "10s" | ||
} | ||
inline = [ | ||
"ls -la" | ||
] | ||
} | ||
# This is a special block that will allow you to undo any changes your scripts have done | ||
# if you are destroying a VM, like unregistering from a service where the VM was registered | ||
on_destroy_script { | ||
// Retry the script 4 times with 10 seconds between each attempt | ||
retry { | ||
attempts = 4 | ||
wait_between_attempts = "10s" | ||
} | ||
inline = [ | ||
"rm -rf /tmp/*" | ||
] | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `base_vm_id` (String) Base Virtual Machine Id to clone | ||
- `host` (String) Parallels Desktop API host | ||
- `name` (String) Virtual Machine name to create, this needs to be unique in the host | ||
- `path` (String) Path | ||
|
||
### Optional | ||
|
||
- `authenticator` (Block, Optional) Authenticator block, this is used to authenticate with the Parallels Desktop API, if empty it will try to use the root password (see [below for nested schema](#nestedblock--authenticator)) | ||
- `config` (Block, Optional) Virtual Machine config block, this is used set some of the most common settings for a VM (see [below for nested schema](#nestedblock--config)) | ||
- `force_changes` (Boolean) Force changes, this will force the VM to be stopped and started again | ||
- `on_destroy_script` (Block List) Run any script after the virtual machine is created (see [below for nested schema](#nestedblock--on_destroy_script)) | ||
- `owner` (String) Virtual Machine owner | ||
- `post_processor_script` (Block List) Run any script after the virtual machine is created (see [below for nested schema](#nestedblock--post_processor_script)) | ||
- `prlctl` (Block List) Virtual Machine config block, this is used set some of the most common settings for a VM (see [below for nested schema](#nestedblock--prlctl)) | ||
- `run_after_create` (Boolean) Run after create, this will make the VM to run after creation | ||
- `shared_folder` (Block List) Shared Folders Block, this is used to share folders with the virtual machine (see [below for nested schema](#nestedblock--shared_folder)) | ||
- `specs` (Block, Optional) Virtual Machine Specs block, this is used to set the specs of the virtual machine (see [below for nested schema](#nestedblock--specs)) | ||
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Virtual Machine Id | ||
- `os_type` (String) Virtual Machine OS type | ||
|
||
<a id="nestedblock--authenticator"></a> | ||
### Nested Schema for `authenticator` | ||
|
||
Optional: | ||
|
||
- `api_key` (String, Sensitive) Parallels desktop API API Key | ||
- `password` (String, Sensitive) Parallels desktop API Password | ||
- `username` (String) Parallels desktop API Username | ||
|
||
|
||
<a id="nestedblock--config"></a> | ||
### Nested Schema for `config` | ||
|
||
Optional: | ||
|
||
- `auto_start_on_host` (Boolean) Start the VM when the host starts, this will stop the VM if it is running | ||
- `enable_rosetta` (Boolean) Enable Rosetta on Apple Silicon, this will stop the VM if it is running | ||
- `pause_idle` (Boolean) Pause the VM when the host is idle, this will stop the VM if it is running | ||
- `start_headless` (Boolean) Set the VM to start headless, this will stop the VM if it is running | ||
|
||
|
||
<a id="nestedblock--on_destroy_script"></a> | ||
### Nested Schema for `on_destroy_script` | ||
|
||
Optional: | ||
|
||
- `inline` (List of String) Inline script | ||
- `retry` (Block, Optional) Retry settings (see [below for nested schema](#nestedblock--on_destroy_script--retry)) | ||
|
||
Read-Only: | ||
|
||
- `result` (Attributes List, Sensitive) Result of the script (see [below for nested schema](#nestedatt--on_destroy_script--result)) | ||
|
||
<a id="nestedblock--on_destroy_script--retry"></a> | ||
### Nested Schema for `on_destroy_script.retry` | ||
|
||
Optional: | ||
|
||
- `attempts` (Number) Number of attempts | ||
- `wait_between_attempts` (String) Wait between attempts, you can use the suffixes 's' for seconds, 'm' for minutes | ||
|
||
|
||
<a id="nestedatt--on_destroy_script--result"></a> | ||
### Nested Schema for `on_destroy_script.result` | ||
|
||
Optional: | ||
|
||
- `exit_code` (String) Exit code | ||
- `script` (String) Script | ||
- `stderr` (String) Stderr | ||
- `stdout` (String) Stdout | ||
|
||
|
||
|
||
<a id="nestedblock--post_processor_script"></a> | ||
### Nested Schema for `post_processor_script` | ||
|
||
Optional: | ||
|
||
- `inline` (List of String) Inline script | ||
- `retry` (Block, Optional) Retry settings (see [below for nested schema](#nestedblock--post_processor_script--retry)) | ||
|
||
Read-Only: | ||
|
||
- `result` (Attributes List, Sensitive) Result of the script (see [below for nested schema](#nestedatt--post_processor_script--result)) | ||
|
||
<a id="nestedblock--post_processor_script--retry"></a> | ||
### Nested Schema for `post_processor_script.retry` | ||
|
||
Optional: | ||
|
||
- `attempts` (Number) Number of attempts | ||
- `wait_between_attempts` (String) Wait between attempts, you can use the suffixes 's' for seconds, 'm' for minutes | ||
|
||
|
||
<a id="nestedatt--post_processor_script--result"></a> | ||
### Nested Schema for `post_processor_script.result` | ||
|
||
Optional: | ||
|
||
- `exit_code` (String) Exit code | ||
- `script` (String) Script | ||
- `stderr` (String) Stderr | ||
- `stdout` (String) Stdout | ||
|
||
|
||
|
||
<a id="nestedblock--prlctl"></a> | ||
### Nested Schema for `prlctl` | ||
|
||
Optional: | ||
|
||
- `flags` (List of String) Set the VM flags, this will stop the VM if it is running | ||
- `operation` (String) Set the VM to start headless, this will stop the VM if it is running | ||
- `options` (Attributes List) Set the VM options, this will stop the VM if it is running (see [below for nested schema](#nestedatt--prlctl--options)) | ||
|
||
<a id="nestedatt--prlctl--options"></a> | ||
### Nested Schema for `prlctl.options` | ||
|
||
Optional: | ||
|
||
- `flag` (String) Set the VM option flag, this will stop the VM if it is running | ||
- `value` (String) Set the VM option value, this will stop the VM if it is running | ||
|
||
|
||
|
||
<a id="nestedblock--shared_folder"></a> | ||
### Nested Schema for `shared_folder` | ||
|
||
Optional: | ||
|
||
- `description` (String) Description | ||
- `disabled` (Boolean) Disabled | ||
- `name` (String) Shared folder name | ||
- `path` (String) Path to share | ||
- `readonly` (Boolean) Read only | ||
|
||
|
||
<a id="nestedblock--specs"></a> | ||
### Nested Schema for `specs` | ||
|
||
Optional: | ||
|
||
- `cpu_count` (String) The number of CPUs of the virtual machine. | ||
- `disk_size` (String) The size of the disk of the virtual machine in megabytes. | ||
- `force` (Boolean) Force the specs to be set, this will stop the VM if it is running | ||
- `memory_size` (String) The amount of memory of the virtual machine in megabytes. | ||
|
||
|
||
<a id="nestedatt--timeouts"></a> | ||
### Nested Schema for `timeouts` | ||
|
||
Optional: | ||
|
||
- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.