mirror of
https://github.com/letic/terraform-provider-proxmox.git
synced 2024-07-05 17:12:38 +00:00
Document login ENV.
Change agent default to match proxmox default
This commit is contained in:
parent
f7bc26dfe8
commit
24a4408337
18
README.md
18
README.md
|
@ -29,9 +29,21 @@ make install
|
||||||
|
|
||||||
Recommended ISO builder https://github.com/Telmate/terraform-ubuntu-proxmox-iso
|
Recommended ISO builder https://github.com/Telmate/terraform-ubuntu-proxmox-iso
|
||||||
|
|
||||||
|
## Credentials
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Credentials and URL optionally defined in the environment
|
||||||
|
export PM_API_URL="https://xxxx.com:8006/api2/json"
|
||||||
|
export PM_USER=user@pam
|
||||||
|
export PM_PASS=password
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
|
|
||||||
```
|
```
|
||||||
|
terraform init
|
||||||
|
terraform plan
|
||||||
terraform apply
|
terraform apply
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -41,6 +53,12 @@ main.tf:
|
||||||
```
|
```
|
||||||
provider "proxmox" {
|
provider "proxmox" {
|
||||||
pm_tls_insecure = true
|
pm_tls_insecure = true
|
||||||
|
/*
|
||||||
|
// Credentials here or environment
|
||||||
|
pm_api_url = "https://proxmox-server01.example.com:8006/api2/json"
|
||||||
|
pm_password = "secret"
|
||||||
|
pm_user = "terraform-user@pve"
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Uses cloud-init options from Proxmox 5.2 */
|
/* Uses cloud-init options from Proxmox 5.2 */
|
||||||
|
|
|
@ -50,7 +50,7 @@ func resourceVmQemu() *schema.Resource {
|
||||||
"agent": {
|
"agent": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: 1,
|
Default: 0,
|
||||||
},
|
},
|
||||||
"iso": {
|
"iso": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -66,6 +66,12 @@ func resourceVmQemu() *schema.Resource {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "l26",
|
Default: "l26",
|
||||||
|
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
|
||||||
|
if new == "l26" {
|
||||||
|
return len(d.Get("clone").(string)) > 0 // the cloned source may have a different os, which we shoud leave alone
|
||||||
|
}
|
||||||
|
return strings.TrimSpace(old) == strings.TrimSpace(new)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"memory": {
|
"memory": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
|
@ -589,6 +595,7 @@ func resourceVmQemuRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
d.Set("name", config.Name)
|
d.Set("name", config.Name)
|
||||||
d.Set("desc", config.Description)
|
d.Set("desc", config.Description)
|
||||||
d.Set("onboot", config.Onboot)
|
d.Set("onboot", config.Onboot)
|
||||||
|
d.Set("agent", config.Agent)
|
||||||
d.Set("memory", config.Memory)
|
d.Set("memory", config.Memory)
|
||||||
d.Set("cores", config.QemuCores)
|
d.Set("cores", config.QemuCores)
|
||||||
d.Set("sockets", config.QemuSockets)
|
d.Set("sockets", config.QemuSockets)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user