ap34
This commit is contained in:
parent
281b589527
commit
e3bd661307
24
ap44/terraform/.terraform.lock.hcl
generated
Normal file
24
ap44/terraform/.terraform.lock.hcl
generated
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# This file is maintained automatically by "terraform init".
|
||||||
|
# Manual edits may be lost in future updates.
|
||||||
|
|
||||||
|
provider "registry.terraform.io/telmate/proxmox" {
|
||||||
|
version = "2.9.11"
|
||||||
|
constraints = "2.9.11"
|
||||||
|
hashes = [
|
||||||
|
"h1:RKM2pvHNJrQKcMD7omaPiM099vWGgDnnZqn1kGknYXU=",
|
||||||
|
"zh:0db1e3940cf208e56919e68c6d557dfc87d380316a474c8999916308bf991440",
|
||||||
|
"zh:2a0ae7af5b2f96d53b24f34575bc72ccbb79cab870901f26f00a301613f7c69e",
|
||||||
|
"zh:2f9eb4a4d2c5db04ec0940d7e250aaf1bac559acc787a5883688ba42159f8b8e",
|
||||||
|
"zh:362a5b44995a51c8de78f0106aa7741f212bb15fbf2d7477794ea3ee63e2c17d",
|
||||||
|
"zh:4d212404b741848cef1e469e390ad1df659bbfa8d47cd079d82d83c288925438",
|
||||||
|
"zh:54a65a01946839db263f8da389791863f6909db9d5fcfdb472e23b14883a5b6c",
|
||||||
|
"zh:5dfc95303efc53686b23762dfa4c50d887eb4cc0a3e9d527adc29b3a9f0439eb",
|
||||||
|
"zh:68db84c007cbdd7267d1f7b767b0b2b91e9ee2e2b92ac1d8a1568f3bc61e67cd",
|
||||||
|
"zh:85d45466445883ae64eed3d5fcb996de389ecf9268f0f7d2f22911fb3f56a344",
|
||||||
|
"zh:8673f8c794ea8413dc9a3933902492b3e5be99e79bc611fcef415be7d7268210",
|
||||||
|
"zh:d5041f72f550f3c81dafecb4e7dfca9f849737154a0e2c81434df6c72d75af25",
|
||||||
|
"zh:e60e03b495dd76660784a8ab07d8db0ce1df7165e713efb350c1864d92f87a8c",
|
||||||
|
"zh:ed1f75a2fe7d764356119a590f301ab8fd40cfeea78a514450868beb92115f28",
|
||||||
|
"zh:efa4140b78775509665370c915e60c9043a1325d608f96da151f8f7fcc7cb45e",
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2017 <copyright holders>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
@ -0,0 +1,53 @@
|
|||||||
|
[](https://travis-ci.com/Telmate/terraform-provider-proxmox)
|
||||||
|
|
||||||
|
# Terraform provider plugin for Proxmox
|
||||||
|
|
||||||
|
This repository provides a Terraform provider for
|
||||||
|
the [Proxmox virtualization platform](https://pve.proxmox.com/pve-docs/) and exposes Terraform resources to provision
|
||||||
|
QEMU VMs and LXC Containers.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
In order to get started, use [the documentation included in this repository](docs/index.md). The documentation contains
|
||||||
|
a list of the options for the provider. Moreover, there are some guides available how to combine options and start
|
||||||
|
specific VMs.
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
Follow this [install guide](docs/guides/installation.md) to install the plugin.
|
||||||
|
|
||||||
|
## Known Limitations
|
||||||
|
|
||||||
|
* `proxmox_vm_qemu`.`disk`.`size` attribute does not match what is displayed in the Proxmox UI.
|
||||||
|
* Updates to `proxmox_vm_qemu` resources almost always result as a failed task within the Proxmox UI. This appears to be
|
||||||
|
harmless and the desired configuration changes do get applied.
|
||||||
|
* `proxmox_vm_qemu` does not (yet) validate vm names, be sure to only use alphanumeric and dashes otherwise you may get
|
||||||
|
an opaque 400 Parameter Verification failed (indicating a bad value was sent to proxmox).
|
||||||
|
* When using the `proxmox_lxc` resource, the provider will crash unless `rootfs` is defined.
|
||||||
|
* When using the Network Boot mode (PXE), a valid NIC must be defined for the VM, and the boot order must specify network first.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
When contributing, please also add documentation to help other users.
|
||||||
|
|
||||||
|
### Debugging the provider
|
||||||
|
|
||||||
|
Debugging is available for this provider through the Terraform Plugin SDK versions 2.0.0. Therefore, the plugin can be
|
||||||
|
started with the debugging flag `--debug`.
|
||||||
|
|
||||||
|
For example (using [delve](https://github.com/go-delve/delve) as Debugger):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dlv exec --headless ./terraform-provider-my-provider -- --debug
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information about debugging a provider please
|
||||||
|
see: [Debugger-Based Debugging](https://www.terraform.io/docs/extend/debugging.html#debugger-based-debugging)
|
||||||
|
|
||||||
|
## Useful links
|
||||||
|
|
||||||
|
* [Proxmox](https://www.proxmox.com/en/)
|
||||||
|
* [Proxmox documentation](https://pve.proxmox.com/pve-docs/)
|
||||||
|
* [Terraform](https://www.terraform.io/)
|
||||||
|
* [Terraform documentation](https://www.terraform.io/docs/index.html)
|
||||||
|
* [Recommended ISO builder](https://github.com/Telmate/terraform-ubuntu-proxmox-iso)
|
Binary file not shown.
30
ap44/terraform/ap44-test.tf
Normal file
30
ap44/terraform/ap44-test.tf
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
resource "proxmox_vm_qemu" "ap44-test" {
|
||||||
|
name = "ap44-test"
|
||||||
|
os_type = "cloudinit"
|
||||||
|
desc = "Serveur de test ap44"
|
||||||
|
target_node = "pxlab3" # la machine Proxmox cible
|
||||||
|
clone = "Debian-11.6-Template" # le nom de la template a cloner
|
||||||
|
cores = 1
|
||||||
|
sockets = 1
|
||||||
|
memory = 1024
|
||||||
|
|
||||||
|
ipconfig0 = "ip=dhcp" # ou bien ip=dhcp
|
||||||
|
ssh_user = "debian" # le compte SSH de connexion par défaut
|
||||||
|
|
||||||
|
sshkeys = <<-EOT
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDOIIu5o8oGZx6fyqRnWZ3ZHf9vV5bpUUKpJ/CzLP6/VkC19ym7Vz76mT7FkMjZ5pwabEv5uYe9suZmA5ut+Y86VybE1SQtpmH4rPsEoYFNTF7mLJtmMAPMsvksd2C3ybk8q9c4asNB3apX+JdfJqEwAKQIIwLQmIsZbSd9aQbinrL+6URew9MvLSaYN/IuPjDLX1tDAOQAqIACE9B07wWviqj+gZDMy/FiFV5IQsdedsFo7z4IxWT3xJYeGck8W4WgVB6NsV78ytD73BYAn6KMg1DvGR35M9TtjXSBtLhtDUx0l3rCqJpaUk+v1/ftChzwntBRXB2R5vo3K4zJlZc4ndtQo2sxUV1HlzuY0MH8Hvqy0b1sXYraVdWeitjHtv3ckzst/PdgPalb3YggYGPwf9THTeHV8Efh89hXZrGapS6U3u7m8Cg4bF2vH4vkBZ49Ab9jj2OjPAtO+xA7RBN2/168Nli2ySY4QvjK4XYB56KxDoPiQgAkC7fak8kiP7s= sio@lab213-22
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDDnruMVFiHqxfyGRN6jAYFYinpXpeuWdN28f3RhtTl1CjnTflLqsSVpafzzdUrXl6Lu5XwuzHFwXSk2jcGGORLVQ1plURJV1VSNlVQcMH97gb19zV7DakGn7S2doKa1x98gKLmaoce5TEdCbuM6bzB/HTfs9UpFnMEqcuz2fae4k+xjBcuRmC9POy8xF4eIlTbEy4oWrArDlkP/5yPSnVCrwAsTIFEtUZVHo+I4i+oJy7kpoQQlNWSa1rqsDx1/mZqIWY+fSh56c3XiBYK5IFjweQjzNfGoGfEpwP4Cv0V6HktlhcEt3PJDgLfzItLdBjS3hcvAk9wWDHikGqSaQcSm0tTTnqnYQVaVA8ULL8ClLFLANxysfMvb91z8Sdgf6nfMzbgRABGrWndePcFyphSJDmJGT2Up6Os+W1wCn3wLpMBPx0tYYprN/Lk4YTfoR37JgeDT70J1HoY75MNrzZW7pvCvs4obyFBt3HA8Q1vct4CSlSDtheactvG4QVTAUM= anas.bouzbakh@lab213-21
|
||||||
|
EOT
|
||||||
|
|
||||||
|
network {
|
||||||
|
model = "virtio"
|
||||||
|
bridge = "vmbr0" # le bridge standard pour l'interface réseau
|
||||||
|
}
|
||||||
|
|
||||||
|
disk {
|
||||||
|
type = "scsi"
|
||||||
|
storage = "local-lvm"
|
||||||
|
size = "10G"
|
||||||
|
format = "raw"
|
||||||
|
}
|
||||||
|
}
|
27
ap44/terraform/main.tf
Normal file
27
ap44/terraform/main.tf
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
provider "proxmox" {
|
||||||
|
pm_api_url = "https://pxlab3.sio.lan:8006/api2/json"
|
||||||
|
# pm_api_token_id = "<user-id>"
|
||||||
|
# pm_api_token_secret = "<secret key>"
|
||||||
|
pm_user = "root@pam"
|
||||||
|
pm_password = "Azerty1+"
|
||||||
|
pm_tls_insecure = true
|
||||||
|
pm_debug = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
variable "pm_api_url" {
|
||||||
|
default = "https://pxlab3:8006/api2/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "pm_user" {
|
||||||
|
default = "root@pam"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "pm_password" {
|
||||||
|
default = "Azerty1+"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
variable "ssh_key" {
|
||||||
|
default = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDd97G/Uw3zlnhVByjpHZFw9FDa88phFUMtYfstTq7wYlUOJB2rdLPpU0bAjIpvpYmHOmBNseWYKaOT7EXNdxWPWJGuoen23tqdSzhnOV0LJz8zbCIA0Ykz/XOqRyJkq6qUw+L3atDxVC5pSSSY279yJtuQ2nmVld2KWDY4lnyZzZT5eQsrxCbT57hVMLCKcMKNb4QnYlLgnyHW8DyWHGG5GEWF9skFSPlmwY5s5H3OYg3u8ijuGjenjDTzLfRUzFltGJ2kBYbIn1iailArKpCiasmJyyja+YuYn3WwaNcl8Tpqa8eI52/LtOXDMwUKzvRJ6D6INEr/1duGYP/fQSEH root@ansible"
|
||||||
|
}
|
148
ap44/terraform/terraform.tfstate
Normal file
148
ap44/terraform/terraform.tfstate
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"terraform_version": "1.3.6",
|
||||||
|
"serial": 1,
|
||||||
|
"lineage": "1182d2dd-3849-a5bb-04a0-e36dfd7ba064",
|
||||||
|
"outputs": {},
|
||||||
|
"resources": [
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "proxmox_vm_qemu",
|
||||||
|
"name": "ap44-test",
|
||||||
|
"provider": "provider[\"registry.terraform.io/telmate/proxmox\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"additional_wait": 0,
|
||||||
|
"agent": 0,
|
||||||
|
"args": "",
|
||||||
|
"automatic_reboot": true,
|
||||||
|
"balloon": 0,
|
||||||
|
"bios": "seabios",
|
||||||
|
"boot": "c",
|
||||||
|
"bootdisk": "scsi0",
|
||||||
|
"bridge": "",
|
||||||
|
"ci_wait": null,
|
||||||
|
"cicustom": "",
|
||||||
|
"cipassword": "",
|
||||||
|
"ciuser": "",
|
||||||
|
"clone": "Debian-11.6-Template",
|
||||||
|
"clone_wait": 0,
|
||||||
|
"cloudinit_cdrom_storage": null,
|
||||||
|
"cores": 1,
|
||||||
|
"cpu": "host",
|
||||||
|
"default_ipv4_address": null,
|
||||||
|
"define_connection_info": true,
|
||||||
|
"desc": "Serveur de test ap44",
|
||||||
|
"disk": [
|
||||||
|
{
|
||||||
|
"aio": "",
|
||||||
|
"backup": 0,
|
||||||
|
"cache": "none",
|
||||||
|
"discard": "",
|
||||||
|
"file": "vm-117-disk-0",
|
||||||
|
"format": "raw",
|
||||||
|
"iops": 0,
|
||||||
|
"iops_max": 0,
|
||||||
|
"iops_max_length": 0,
|
||||||
|
"iops_rd": 0,
|
||||||
|
"iops_rd_max": 0,
|
||||||
|
"iops_rd_max_length": 0,
|
||||||
|
"iops_wr": 0,
|
||||||
|
"iops_wr_max": 0,
|
||||||
|
"iops_wr_max_length": 0,
|
||||||
|
"iothread": 0,
|
||||||
|
"mbps": 0,
|
||||||
|
"mbps_rd": 0,
|
||||||
|
"mbps_rd_max": 0,
|
||||||
|
"mbps_wr": 0,
|
||||||
|
"mbps_wr_max": 0,
|
||||||
|
"media": "",
|
||||||
|
"replicate": 0,
|
||||||
|
"size": "10G",
|
||||||
|
"slot": 0,
|
||||||
|
"ssd": 0,
|
||||||
|
"storage": "local-lvm",
|
||||||
|
"storage_type": "lvmthin",
|
||||||
|
"type": "scsi",
|
||||||
|
"volume": "local-lvm:vm-117-disk-0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"disk_gb": 0,
|
||||||
|
"force_create": false,
|
||||||
|
"force_recreate_on_change_of": null,
|
||||||
|
"full_clone": true,
|
||||||
|
"guest_agent_ready_timeout": 100,
|
||||||
|
"hagroup": "",
|
||||||
|
"hastate": "",
|
||||||
|
"hotplug": "network,disk,usb",
|
||||||
|
"id": "pxlab3/qemu/117",
|
||||||
|
"ipconfig0": "ip=dhcp",
|
||||||
|
"ipconfig1": "",
|
||||||
|
"ipconfig2": "",
|
||||||
|
"ipconfig3": "",
|
||||||
|
"ipconfig4": "",
|
||||||
|
"ipconfig5": "",
|
||||||
|
"iso": null,
|
||||||
|
"kvm": true,
|
||||||
|
"mac": "",
|
||||||
|
"memory": 1024,
|
||||||
|
"name": "ap44-test",
|
||||||
|
"nameserver": "",
|
||||||
|
"network": [
|
||||||
|
{
|
||||||
|
"bridge": "vmbr0",
|
||||||
|
"firewall": false,
|
||||||
|
"link_down": false,
|
||||||
|
"macaddr": "2A:1A:93:F1:FE:AA",
|
||||||
|
"model": "virtio",
|
||||||
|
"mtu": 0,
|
||||||
|
"queues": 0,
|
||||||
|
"rate": 0,
|
||||||
|
"tag": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"nic": "",
|
||||||
|
"numa": false,
|
||||||
|
"onboot": false,
|
||||||
|
"oncreate": true,
|
||||||
|
"os_network_config": null,
|
||||||
|
"os_type": "cloudinit",
|
||||||
|
"pool": "",
|
||||||
|
"preprovision": true,
|
||||||
|
"pxe": null,
|
||||||
|
"qemu_os": "other",
|
||||||
|
"reboot_required": false,
|
||||||
|
"scsihw": "virtio-scsi-pci",
|
||||||
|
"searchdomain": "",
|
||||||
|
"serial": [],
|
||||||
|
"sockets": 1,
|
||||||
|
"ssh_forward_ip": null,
|
||||||
|
"ssh_host": null,
|
||||||
|
"ssh_port": null,
|
||||||
|
"ssh_private_key": null,
|
||||||
|
"ssh_user": "debian",
|
||||||
|
"sshkeys": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDOIIu5o8oGZx6fyqRnWZ3ZHf9vV5bpUUKpJ/CzLP6/VkC19ym7Vz76mT7FkMjZ5pwabEv5uYe9suZmA5ut+Y86VybE1SQtpmH4rPsEoYFNTF7mLJtmMAPMsvksd2C3ybk8q9c4asNB3apX+JdfJqEwAKQIIwLQmIsZbSd9aQbinrL+6URew9MvLSaYN/IuPjDLX1tDAOQAqIACE9B07wWviqj+gZDMy/FiFV5IQsdedsFo7z4IxWT3xJYeGck8W4WgVB6NsV78ytD73BYAn6KMg1DvGR35M9TtjXSBtLhtDUx0l3rCqJpaUk+v1/ftChzwntBRXB2R5vo3K4zJlZc4ndtQo2sxUV1HlzuY0MH8Hvqy0b1sXYraVdWeitjHtv3ckzst/PdgPalb3YggYGPwf9THTeHV8Efh89hXZrGapS6U3u7m8Cg4bF2vH4vkBZ49Ab9jj2OjPAtO+xA7RBN2/168Nli2ySY4QvjK4XYB56KxDoPiQgAkC7fak8kiP7s= sio@lab213-22\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDDnruMVFiHqxfyGRN6jAYFYinpXpeuWdN28f3RhtTl1CjnTflLqsSVpafzzdUrXl6Lu5XwuzHFwXSk2jcGGORLVQ1plURJV1VSNlVQcMH97gb19zV7DakGn7S2doKa1x98gKLmaoce5TEdCbuM6bzB/HTfs9UpFnMEqcuz2fae4k+xjBcuRmC9POy8xF4eIlTbEy4oWrArDlkP/5yPSnVCrwAsTIFEtUZVHo+I4i+oJy7kpoQQlNWSa1rqsDx1/mZqIWY+fSh56c3XiBYK5IFjweQjzNfGoGfEpwP4Cv0V6HktlhcEt3PJDgLfzItLdBjS3hcvAk9wWDHikGqSaQcSm0tTTnqnYQVaVA8ULL8ClLFLANxysfMvb91z8Sdgf6nfMzbgRABGrWndePcFyphSJDmJGT2Up6Os+W1wCn3wLpMBPx0tYYprN/Lk4YTfoR37JgeDT70J1HoY75MNrzZW7pvCvs4obyFBt3HA8Q1vct4CSlSDtheactvG4QVTAUM= anas.bouzbakh@lab213-21\n\n",
|
||||||
|
"startup": "",
|
||||||
|
"storage": "",
|
||||||
|
"storage_type": "",
|
||||||
|
"tablet": true,
|
||||||
|
"tags": "",
|
||||||
|
"target_node": "pxlab3",
|
||||||
|
"timeouts": null,
|
||||||
|
"unused_disk": [],
|
||||||
|
"usb": [],
|
||||||
|
"vcpus": 0,
|
||||||
|
"vga": [],
|
||||||
|
"vlan": -1,
|
||||||
|
"vmid": null
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlZmF1bHQiOjMwMDAwMDAwMDAwMCwiZGVsZXRlIjoxODAwMDAwMDAwMDAsInJlYWQiOjE4MDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDB9fQ=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"check_results": null
|
||||||
|
}
|
9
ap44/terraform/vars.tf
Normal file
9
ap44/terraform/vars.tf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
proxmox = {
|
||||||
|
source = "telmate/proxmox"
|
||||||
|
version = "2.9.11"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user