├── README.md ├── .gitignore ├── LICENSE └── main.go /README.md: -------------------------------------------------------------------------------- 1 | # terraform-provider-proxmox 2 | A terraform provider for Proxmox 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jeff Hubbard 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/plugin" 5 | "github.com/hashicorp/terraform/helper/schema" 6 | "github.com/lord2800/proxmox-api" 7 | ) 8 | 9 | func main() { 10 | plugin.Serve(new(Proxmox)) 11 | } 12 | 13 | func Proxmox() schema.ResourceProvider { 14 | return &schema.Provider{ 15 | Schema: map[string]*schema.Schema{ 16 | "host": &schema.Schema{ 17 | Type: schema.TypeString, 18 | Required: true, 19 | Description: "The URL to use as the base of the api" 20 | }, 21 | "user": &schema.Schema{ 22 | Type: schema.TypeString, 23 | Required: true, 24 | Description: "The user to authenticate as" 25 | }, 26 | "pass": &schema.Schema{ 27 | Type: schema.TypeString, 28 | Required: true, 29 | Description: "The password for the specified user" 30 | } 31 | }, 32 | ResourcesMap: map[string]*schema.Resource{ 33 | "proxmox_vm": &schema.Resource{ 34 | Schema: map[string]*schema.Schema{ 35 | "name": &schema.Schema{ 36 | Type: schema.TypeString, 37 | Required: true, 38 | Description: "The name of the machine" 39 | }, 40 | "id": &schema.Schema{ 41 | Type: schema.TypeString, 42 | Required: false, 43 | Description: "The id of the machine" 44 | } 45 | } 46 | SchemaVersion: 1, 47 | Create: func(d *schema.ResourceData, meta interface{}) {}, 48 | Read: func(d *schema.ResourceData, meta interface{}) {}, 49 | Update: func(d *schema.ResourceData, meta interface{}) {}, 50 | Delete: func(d *schema.ResourceData, meta interface{}) {}, 51 | } 52 | }, 53 | ConfigureFunc: func(*schema.ResourceData) (interface{}, error) {}, 54 | } 55 | } 56 | --------------------------------------------------------------------------------