diff --git a/proxmox/terraform/modules/node/main.tf b/proxmox/terraform/modules/node/main.tf --- a/proxmox/terraform/modules/node/main.tf +++ b/proxmox/terraform/modules/node/main.tf @@ -89,7 +89,9 @@ "sed -i 's/127.0.1.1/${lookup(var.networks[0], "ip")}/g' /etc/hosts", # so puppet agent installs the node's role "puppet agent --server ${var.config["puppet_master"]} --environment=${var.config["puppet_environment"]} --waitforcert 60 --test || echo 'Node provisionned!'", - ]) + ], + var.post_provision_steps, + ) connection { type = "ssh" diff --git a/proxmox/terraform/modules/node/outputs.tf b/proxmox/terraform/modules/node/outputs.tf --- a/proxmox/terraform/modules/node/outputs.tf +++ b/proxmox/terraform/modules/node/outputs.tf @@ -3,8 +3,7 @@ hostname: ${proxmox_vm_qemu.node.name} fqdn: ${proxmox_vm_qemu.node.name}.${var.config["domain"]} -network: ${proxmox_vm_qemu.node.ipconfig0} macaddrs=${join(",", proxmox_vm_qemu.node.network[*]["macaddr"])} -vmid: ${proxmox_vm_qemu.node.vmid} +network: ${proxmox_vm_qemu.node.ipconfig0} EOF } diff --git a/proxmox/terraform/modules/node/variables.tf b/proxmox/terraform/modules/node/variables.tf --- a/proxmox/terraform/modules/node/variables.tf +++ b/proxmox/terraform/modules/node/variables.tf @@ -54,7 +54,7 @@ id = number ip = string gateway = string - macaddr = string + macaddr = optional(string) bridge = string })) default = [] @@ -102,7 +102,13 @@ } variable "pre_provision_steps" { - description = "List of sequential provisioning steps to apply" + description = "Sequential provisioning steps to apply *before* common provision steps" + type = list(string) + default = [] +} + +variable "post_provision_steps" { + description = "Sequential provisioning steps to apply *after* common provision steps" type = list(string) default = [] } diff --git a/proxmox/terraform/staging/rancher.tf b/proxmox/terraform/staging/rancher.tf --- a/proxmox/terraform/staging/rancher.tf +++ b/proxmox/terraform/staging/rancher.tf @@ -39,5 +39,125 @@ } output "rancher2_cluster_command" { + sensitive = true value = rancher2_cluster.staging-workers.cluster_registration_token[0].node_command } + +module "elastic-worker0" { + source = "../modules/node" + template = "debian-bullseye-11.3-zfs-2022-04-21" + vmid = 146 + config = local.config + hostname = "elastic-worker0" + description = "elastic worker running in rancher cluster" + hypervisor = "uffizi" + sockets = "1" + cores = "4" + onboot = true + memory = "4096" + balloon = "1024" + + networks = [{ + id = 0 + ip = "192.168.130.130" + gateway = local.config["gateway_ip"] + macaddr = "72:CF:A9:AC:B8:EE" + bridge = "vmbr443" + }] + + storages = [{ + storage = "proxmox" + size = "20G" + }, { + storage = "proxmox" + size = "50G" + } + ] + + post_provision_steps = [ + "systemctl restart docker", # workaround + "${rancher2_cluster.staging-workers.cluster_registration_token[0].node_command} --etcd --controlplane --worker" + ] +} + +output "elastic-worker0_summary" { + value = module.elastic-worker0.summary +} + +module "elastic-worker1" { + source = "../modules/node" + template = "debian-bullseye-11.3-zfs-2022-04-21" + config = local.config + hostname = "elastic-worker1" + description = "elastic worker running in rancher cluster" + hypervisor = "uffizi" + sockets = "1" + cores = "4" + onboot = true + memory = "4096" + balloon = "1024" + + networks = [{ + id = 0 + ip = "192.168.130.131" + gateway = local.config["gateway_ip"] + bridge = "vmbr443" + }] + + storages = [{ + storage = "proxmox" + size = "20G" + }, { + storage = "proxmox" + size = "50G" + } + ] + + post_provision_steps = [ + "systemctl restart docker", # workaround + "${rancher2_cluster.staging-workers.cluster_registration_token[0].node_command} --etcd --controlplane --worker" + ] +} + +output "elastic-worker1_summary" { + value = module.elastic-worker1.summary +} + +module "elastic-worker2" { + source = "../modules/node" + template = "debian-bullseye-11.3-zfs-2022-04-21" + config = local.config + hostname = "elastic-worker2" + description = "elastic worker running in rancher cluster" + hypervisor = "uffizi" + sockets = "1" + cores = "4" + onboot = true + memory = "4096" + balloon = "1024" + + networks = [{ + id = 0 + ip = "192.168.130.132" + gateway = local.config["gateway_ip"] + bridge = "vmbr443" + }] + + storages = [{ + storage = "proxmox" + size = "20G" + }, { + storage = "proxmox" + size = "50G" + } + ] + + post_provision_steps = [ + "systemctl restart docker", # workaround + "${rancher2_cluster.staging-workers.cluster_registration_token[0].node_command} --etcd --controlplane --worker" + ] +} + +output "elastic-worker2_summary" { + value = module.elastic-worker2.summary +} diff --git a/proxmox/terraform/staging/terraform.tfstate b/proxmox/terraform/staging/terraform.tfstate --- a/proxmox/terraform/staging/terraform.tfstate +++ b/proxmox/terraform/staging/terraform.tfstate @@ -1,7 +1,7 @@ { "version": 4, - "terraform_version": "1.1.8", - "serial": 206, + "terraform_version": "1.1.9", + "serial": 212, "lineage": "e2912de8-415d-4c35-8ee5-757008306227", "outputs": { "counters0_summary": { @@ -12,6 +12,10 @@ "value": "\nhostname: deposit\nfqdn: deposit.internal.staging.swh.network\nnetwork: ip=192.168.130.31/24,gw=192.168.130.1 macaddrs=9E:81:DD:58:15:3B\nvmid: 120\n", "type": "string" }, + "elastic-worker0_summary": { + "value": "\nhostname: elastic-worker0\nfqdn: elastic-worker0.internal.staging.swh.network\nnetwork: ip=192.168.130.130/24,gw=192.168.130.1 macaddrs=72:CF:A9:AC:B8:EE\nvmid: 146\n", + "type": "string" + }, "maven-exporter0_summary": { "value": "\nhostname: maven-exporter0\nfqdn: maven-exporter0.internal.staging.swh.network\nnetwork: ip=192.168.130.70/24,gw=192.168.130.1 macaddrs=36:86:F6:F9:2A:5D\nvmid: 122\n", "type": "string" @@ -26,7 +30,8 @@ }, "rancher2_cluster_command": { "value": "sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.6.4 --server https://rancher.euwest.azure.internal.softwareheritage.org --token zbtc5cl2l6qfp6jrwmw6jqztmtq6kbdv5m8jk2w7qktq8gb9knb6zq --ca-checksum 8850dd89eb7f29a70c0d50a2b389bf1950808a9dff4062c66ab806b80b988bac", - "type": "string" + "type": "string", + "sensitive": true }, "rancher2_cluster_summary": { "value": "apiVersion: v1\nkind: Config\nclusters:\n- name: \"staging-workers\"\n cluster:\n server: \"https://rancher.euwest.azure.internal.softwareheritage.org/k8s/clusters/c-t85mz\"\n certificate-authority-data: \"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJwekNDQ\\\n VUyZ0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQTdNUnd3R2dZRFZRUUtFeE5rZVc1aGJXbGoKY\\\n kdsemRHVnVaWEl0YjNKbk1Sc3dHUVlEVlFRREV4SmtlVzVoYldsamJHbHpkR1Z1WlhJdFkyRXdIa\\\n GNOTWpJdwpOREV5TWpJek56RTBXaGNOTXpJd05EQTVNakl6TnpFMFdqQTdNUnd3R2dZRFZRUUtFe\\\n E5rZVc1aGJXbGpiR2x6CmRHVnVaWEl0YjNKbk1Sc3dHUVlEVlFRREV4SmtlVzVoYldsamJHbHpkR\\\n 1Z1WlhJdFkyRXdXVEFUQmdjcWhrak8KUFFJQkJnZ3Foa2pPUFFNQkJ3TkNBQVMvTnRpTWV4NDY0K\\\n 0R3RytuQ2svQXdJM2VDSjNGOHdQNitUZytNTjFnaQo3OWJWeEIwd1RTYjZmL3ZXK3NRdEIzdEUrS\\\n k5iaU1mU2xuQUtaVlBjQjA0T28wSXdRREFPQmdOVkhROEJBZjhFCkJBTUNBcVF3RHdZRFZSMFRBU\\\n UgvQkFVd0F3RUIvekFkQmdOVkhRNEVGZ1FVeVUyT1lacnBkbCtWYkIzSkpUcHUKMktiVnF0NHdDZ\\\n 1lJS29aSXpqMEVBd0lEU0FBd1JRSWdRY25JcnJCSzdUbFBBdlRKb3EwNmp5QVplcURzTWI1LwpKZ\\\n Th4QVFnTnV5d0NJUURaWDA2NDJ4NXh2N1lFdmZ4eWJ0SnlRWVY3aTlJZ1llNzlKVG9SaVBQTkZBP\\\n T0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQ==\"\n\nusers:\n- name: \"staging-workers\"\n user:\n token: \"kubeconfig-user-92j6d5nng8:ld4njkk6wh8gwnnczjvcnlrprnf9k227c2w4d4cnh8j67phlxbhjlv\"\n\n\ncontexts:\n- name: \"staging-workers\"\n context:\n user: \"staging-workers\"\n cluster: \"staging-workers\"\n\ncurrent-context: \"staging-workers\"\n", @@ -92,9 +97,14 @@ "aks_config": [], "aks_config_v2": [], "annotations": { - "authz.management.cattle.io/creator-role-bindings": "{\"created\":[\"cluster-owner\"],\"required\":[\"cluster-owner\"]}" + "authz.management.cattle.io/creator-role-bindings": "{\"created\":[\"cluster-owner\"],\"required\":[\"cluster-owner\"]}", + "lifecycle.cattle.io/create.cluster-agent-controller-cleanup": "true", + "lifecycle.cattle.io/create.cluster-provisioner-controller": "true", + "lifecycle.cattle.io/create.cluster-scoped-gc": "true", + "lifecycle.cattle.io/create.mgmt-cluster-rbac-remove": "true", + "provisioner.cattle.io/ke-driver-update": "updated" }, - "ca_cert": null, + "ca_cert": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM0VENDQWNtZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFTTVJBd0RnWURWUVFERXdkcmRXSmwKTFdOaE1CNFhEVEl5TURReU1URTFNekUwTlZvWERUTXlNRFF4T0RFMU16RTBOVm93RWpFUU1BNEdBMVVFQXhNSAphM1ZpWlMxallUQ0NBU0l3RFFZSktvWklodmNOQVFFQkJRQURnZ0VQQURDQ0FRb0NnZ0VCQU1zQndXWHZpYllzCmRMS0tZaUxZTUpObzFGY0xNQzZzdzcxdVp6S3VydEpTaWhBS3RFaXZwVW9ZZk95alh1TXRuYVdoMkNtdVY0ZVAKYURTRFlXam9iM2JlMVZyN2I1eVZPWXhzUWZqeCtBUkxPbzRNWlp0UUZFdTY4dGhxdGp3aFl4MjRxczVYaUUvQQpNeFJKeWxZVUdsbzJVTXRSZWtKLzhRZWhoL0xkbks0bm8yaDBLWUl2eHVrcnREaVZreE55TGtOMEovWTlVS29MCnF5NzJWN3NlR3ArYjFpZHprVjhuM3VQYzFWb2poOUtIRFIrZDVYN2JheUM0OXVUU1hsaC9iOW9GN21mS3BSWDcKbGxEUjhDZlFoaVFNYTMzdlBkZzludGxXUzFhOWljOUM0MUNwREprQ1o2RTZtd1F6UTZzUGw0NDRMeVdISlgyWgpVUVhYV1B6b2xiOENBd0VBQWFOQ01FQXdEZ1lEVlIwUEFRSC9CQVFEQWdLa01BOEdBMVVkRXdFQi93UUZNQU1CCkFmOHdIUVlEVlIwT0JCWUVGUGFGMGJqdU9GWDhLK0E1dXdTNDQzRFFPTmU3TUEwR0NTcUdTSWIzRFFFQkN3VUEKQTRJQkFRQklreithbXpVVkZxQVd5YVR1bHVRNmduMzlGbXkwOHptQWtEdDRMTW1ndE1UVy9jRjArTlVQQnpmcQowS1BXRGJ4R01icHBMRThZM2FONTUxVUMrcUo4Z2E1RkxNSm1mVmlkc2lJVGtqS1lnZ21xRUJmZ0loUGtsKzJRClFIYlUrVGZIWGg5RmZDMWhONVJLTjVwYXkzei9MSGpTa2RTYXNBRDRMdWlCajY2QStPREtJeGxWUVlCWnFuVm8KYVV3RUVNTmRKUUFoRUdyZVZHdm5VVkt6RHBxcTZzVVFqSGtteFJaVXBQd3ArWFhBV0FnTEN1cHd6VVFKZHg4cgpEWk9sVWNEUlFSaFErRHZiVHR4MlUrR1VaR2lxTUpWQUx6SXlEWUZQWEphaUF1cXdManJyblMveVMvMUxDYVhKClo3RVBMNUszUDFHTEVZYjNkMG9KdXBSS0tSK0wKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=", "cluster_auth_endpoint": [ { "ca_certs": "", @@ -122,9 +132,9 @@ "windows_node_command": "PowerShell -NoLogo -NonInteractive -Command \"\u0026 {docker run -v c:\\:c:\\host rancher/rancher-agent:v2.6.4 bootstrap --server https://rancher.euwest.azure.internal.softwareheritage.org --token zbtc5cl2l6qfp6jrwmw6jqztmtq6kbdv5m8jk2w7qktq8gb9knb6zq --ca-checksum 8850dd89eb7f29a70c0d50a2b389bf1950808a9dff4062c66ab806b80b988bac | iex}\"" } ], - "cluster_template_answers": null, + "cluster_template_answers": [], "cluster_template_id": null, - "cluster_template_questions": null, + "cluster_template_questions": [], "cluster_template_revision_id": null, "default_pod_security_policy_template_id": null, "default_project_id": "c-t85mz:p-x7ls4", @@ -132,9 +142,9 @@ "desired_agent_image": null, "desired_auth_image": null, "docker_root_dir": "/var/lib/docker", - "driver": "", + "driver": "rancherKubernetesEngine", "eks_config": [], - "eks_config_v2": null, + "eks_config_v2": [], "enable_cluster_alerting": false, "enable_cluster_istio": null, "enable_cluster_monitoring": false, @@ -147,7 +157,8 @@ "k3s_config": [], "kube_config": "apiVersion: v1\nkind: Config\nclusters:\n- name: \"staging-workers\"\n cluster:\n server: \"https://rancher.euwest.azure.internal.softwareheritage.org/k8s/clusters/c-t85mz\"\n certificate-authority-data: \"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJwekNDQ\\\n VUyZ0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQTdNUnd3R2dZRFZRUUtFeE5rZVc1aGJXbGoKY\\\n kdsemRHVnVaWEl0YjNKbk1Sc3dHUVlEVlFRREV4SmtlVzVoYldsamJHbHpkR1Z1WlhJdFkyRXdIa\\\n GNOTWpJdwpOREV5TWpJek56RTBXaGNOTXpJd05EQTVNakl6TnpFMFdqQTdNUnd3R2dZRFZRUUtFe\\\n E5rZVc1aGJXbGpiR2x6CmRHVnVaWEl0YjNKbk1Sc3dHUVlEVlFRREV4SmtlVzVoYldsamJHbHpkR\\\n 1Z1WlhJdFkyRXdXVEFUQmdjcWhrak8KUFFJQkJnZ3Foa2pPUFFNQkJ3TkNBQVMvTnRpTWV4NDY0K\\\n 0R3RytuQ2svQXdJM2VDSjNGOHdQNitUZytNTjFnaQo3OWJWeEIwd1RTYjZmL3ZXK3NRdEIzdEUrS\\\n k5iaU1mU2xuQUtaVlBjQjA0T28wSXdRREFPQmdOVkhROEJBZjhFCkJBTUNBcVF3RHdZRFZSMFRBU\\\n UgvQkFVd0F3RUIvekFkQmdOVkhRNEVGZ1FVeVUyT1lacnBkbCtWYkIzSkpUcHUKMktiVnF0NHdDZ\\\n 1lJS29aSXpqMEVBd0lEU0FBd1JRSWdRY25JcnJCSzdUbFBBdlRKb3EwNmp5QVplcURzTWI1LwpKZ\\\n Th4QVFnTnV5d0NJUURaWDA2NDJ4NXh2N1lFdmZ4eWJ0SnlRWVY3aTlJZ1llNzlKVG9SaVBQTkZBP\\\n T0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQ==\"\n\nusers:\n- name: \"staging-workers\"\n user:\n token: \"kubeconfig-user-92j6d5nng8:ld4njkk6wh8gwnnczjvcnlrprnf9k227c2w4d4cnh8j67phlxbhjlv\"\n\n\ncontexts:\n- name: \"staging-workers\"\n context:\n user: \"staging-workers\"\n cluster: \"staging-workers\"\n\ncurrent-context: \"staging-workers\"\n", "labels": { - "cattle.io/creator": "norman" + "cattle.io/creator": "norman", + "provider.cattle.io": "rke" }, "name": "staging-workers", "oke_config": [], @@ -156,7 +167,7 @@ { "addon_job_timeout": 45, "addons": "", - "addons_include": null, + "addons_include": [], "authentication": [ { "sans": [], @@ -181,12 +192,12 @@ ], "cloud_provider": [ { - "aws_cloud_provider": null, - "azure_cloud_provider": null, - "custom_cloud_provider": null, - "name": null, - "openstack_cloud_provider": null, - "vsphere_cloud_provider": null + "aws_cloud_provider": [], + "azure_cloud_provider": [], + "custom_cloud_provider": "", + "name": "", + "openstack_cloud_provider": [], + "vsphere_cloud_provider": [] } ], "dns": [], @@ -345,7 +356,7 @@ "win_prefix_path": "" } ], - "scheduled_cluster_scan": null, + "scheduled_cluster_scan": [], "system_project_id": "c-t85mz:p-spm4t", "timeouts": null, "windows_prefered_cluster": false @@ -609,6 +620,454 @@ } ] }, + { + "module": "module.elastic-worker0", + "mode": "managed", + "type": "proxmox_vm_qemu", + "name": "node", + "provider": "module.elastic-worker0.provider[\"registry.terraform.io/telmate/proxmox\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "additional_wait": 0, + "agent": 0, + "args": "", + "balloon": 1024, + "bios": "seabios", + "boot": "c", + "bootdisk": "", + "bridge": "", + "ci_wait": null, + "cicustom": "", + "cipassword": "", + "ciuser": "root", + "clone": "debian-bullseye-11.3-zfs-2022-04-21", + "clone_wait": 0, + "cloudinit_cdrom_storage": null, + "cores": 4, + "cpu": "kvm64", + "default_ipv4_address": null, + "define_connection_info": true, + "desc": "elastic worker running in rancher cluster", + "disk": [ + { + "backup": 0, + "cache": "none", + "discard": "", + "file": "base-10008-disk-0/vm-146-disk-0", + "format": "raw", + "iothread": 0, + "mbps": 0, + "mbps_rd": 0, + "mbps_rd_max": 0, + "mbps_wr": 0, + "mbps_wr_max": 0, + "media": "", + "replicate": 0, + "size": "20G", + "slot": 0, + "ssd": 0, + "storage": "proxmox", + "storage_type": "rbd", + "type": "virtio", + "volume": "proxmox:base-10008-disk-0/vm-146-disk-0" + }, + { + "backup": 0, + "cache": "none", + "discard": "", + "file": "vm-146-disk-1", + "format": "raw", + "iothread": 0, + "mbps": 0, + "mbps_rd": 0, + "mbps_rd_max": 0, + "mbps_wr": 0, + "mbps_wr_max": 0, + "media": "", + "replicate": 0, + "size": "50G", + "slot": 1, + "ssd": 0, + "storage": "proxmox", + "storage_type": "rbd", + "type": "virtio", + "volume": "proxmox:vm-146-disk-1" + } + ], + "disk_gb": 0, + "force_create": false, + "force_recreate_on_change_of": null, + "full_clone": false, + "guest_agent_ready_timeout": 100, + "hagroup": "", + "hastate": "", + "hotplug": "network,disk,usb", + "id": "uffizi/qemu/146", + "ipconfig0": "ip=192.168.130.130/24,gw=192.168.130.1", + "ipconfig1": "", + "ipconfig2": "", + "ipconfig3": "", + "ipconfig4": "", + "ipconfig5": "", + "iso": null, + "kvm": true, + "mac": "", + "memory": 4096, + "name": "elastic-worker0", + "nameserver": "192.168.100.29", + "network": [ + { + "bridge": "vmbr443", + "firewall": false, + "link_down": false, + "macaddr": "72:CF:A9:AC:B8:EE", + "model": "virtio", + "queues": 0, + "rate": 0, + "tag": -1 + } + ], + "nic": "", + "numa": false, + "onboot": true, + "oncreate": true, + "os_network_config": null, + "os_type": "cloud-init", + "pool": "", + "preprovision": true, + "qemu_os": "other", + "reboot_required": false, + "scsihw": "virtio-scsi-pci", + "searchdomain": "internal.staging.swh.network", + "serial": [], + "sockets": 1, + "ssh_forward_ip": null, + "ssh_host": null, + "ssh_port": null, + "ssh_private_key": null, + "ssh_user": "root", + "sshkeys": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVKCfpeIMg7GS3Pk03ZAcBWAeDZ+AvWk2k/pPY0z8MJ3YAbqZkRtSK7yaDgJV6Gro7nn/TxdJLo2jEzzWvlC8d8AEzhZPy5Z/qfVVjqBTBM4H5+e+TItAHFfaY5+0WvIahxcfsfaq70MWfpJhszAah3ThJ4mqzYaw+dkr42+a7Gx3Ygpb/m2dpnFnxvXdcuAJYStmHKU5AWGWWM+Fm50/fdMqUfNd8MbKhkJt5ihXQmZWMOt7ls4N8i5NZWnS9YSWow8X/ENOEqCRN9TyRkc+pPS0w9DNi0BCsWvSRJOkyvQ6caEnKWlNoywCmM1AlIQD3k4RUgRWe0vqg/UKPpH3Z root@terraform\n", + "storage": "", + "storage_type": "", + "tablet": true, + "tags": "", + "target_node": "uffizi", + "timeouts": null, + "unused_disk": [], + "vcpus": 0, + "vga": [], + "vlan": -1, + "vmid": 146 + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlZmF1bHQiOjMwMDAwMDAwMDAwMCwiZGVsZXRlIjoxODAwMDAwMDAwMDAsInJlYWQiOjE4MDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "rancher2_cluster.staging-workers" + ] + } + ] + }, + { + "module": "module.elastic-worker1", + "mode": "managed", + "type": "proxmox_vm_qemu", + "name": "node", + "provider": "module.elastic-worker1.provider[\"registry.terraform.io/telmate/proxmox\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "additional_wait": 0, + "agent": 0, + "args": "", + "balloon": 1024, + "bios": "seabios", + "boot": "c", + "bootdisk": "", + "bridge": "", + "ci_wait": null, + "cicustom": "", + "cipassword": "", + "ciuser": "root", + "clone": "debian-bullseye-11.3-zfs-2022-04-21", + "clone_wait": 0, + "cloudinit_cdrom_storage": null, + "cores": 4, + "cpu": "kvm64", + "default_ipv4_address": null, + "define_connection_info": true, + "desc": "elastic worker running in rancher cluster", + "disk": [ + { + "backup": 0, + "cache": "none", + "discard": "", + "file": "base-10008-disk-0/vm-147-disk-0", + "format": "raw", + "iothread": 0, + "mbps": 0, + "mbps_rd": 0, + "mbps_rd_max": 0, + "mbps_wr": 0, + "mbps_wr_max": 0, + "media": "", + "replicate": 0, + "size": "20G", + "slot": 0, + "ssd": 0, + "storage": "proxmox", + "storage_type": "rbd", + "type": "virtio", + "volume": "proxmox:base-10008-disk-0/vm-147-disk-0" + }, + { + "backup": 0, + "cache": "none", + "discard": "", + "file": "vm-147-disk-1", + "format": "raw", + "iothread": 0, + "mbps": 0, + "mbps_rd": 0, + "mbps_rd_max": 0, + "mbps_wr": 0, + "mbps_wr_max": 0, + "media": "", + "replicate": 0, + "size": "50G", + "slot": 1, + "ssd": 0, + "storage": "proxmox", + "storage_type": "rbd", + "type": "virtio", + "volume": "proxmox:vm-147-disk-1" + } + ], + "disk_gb": 0, + "force_create": false, + "force_recreate_on_change_of": null, + "full_clone": false, + "guest_agent_ready_timeout": 100, + "hagroup": "", + "hastate": "", + "hotplug": "network,disk,usb", + "id": "uffizi/qemu/147", + "ipconfig0": "ip=192.168.130.131/24,gw=192.168.130.1", + "ipconfig1": "", + "ipconfig2": "", + "ipconfig3": "", + "ipconfig4": "", + "ipconfig5": "", + "iso": null, + "kvm": true, + "mac": "", + "memory": 4096, + "name": "elastic-worker1", + "nameserver": "192.168.100.29", + "network": [ + { + "bridge": "vmbr443", + "firewall": false, + "link_down": false, + "macaddr": "3E:FD:3E:58:CE:85", + "model": "virtio", + "queues": 0, + "rate": 0, + "tag": -1 + } + ], + "nic": "", + "numa": false, + "onboot": true, + "oncreate": true, + "os_network_config": null, + "os_type": "cloud-init", + "pool": "", + "preprovision": true, + "qemu_os": "other", + "reboot_required": false, + "scsihw": "virtio-scsi-pci", + "searchdomain": "internal.staging.swh.network", + "serial": [], + "sockets": 1, + "ssh_forward_ip": null, + "ssh_host": null, + "ssh_port": null, + "ssh_private_key": null, + "ssh_user": "root", + "sshkeys": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVKCfpeIMg7GS3Pk03ZAcBWAeDZ+AvWk2k/pPY0z8MJ3YAbqZkRtSK7yaDgJV6Gro7nn/TxdJLo2jEzzWvlC8d8AEzhZPy5Z/qfVVjqBTBM4H5+e+TItAHFfaY5+0WvIahxcfsfaq70MWfpJhszAah3ThJ4mqzYaw+dkr42+a7Gx3Ygpb/m2dpnFnxvXdcuAJYStmHKU5AWGWWM+Fm50/fdMqUfNd8MbKhkJt5ihXQmZWMOt7ls4N8i5NZWnS9YSWow8X/ENOEqCRN9TyRkc+pPS0w9DNi0BCsWvSRJOkyvQ6caEnKWlNoywCmM1AlIQD3k4RUgRWe0vqg/UKPpH3Z root@terraform\n", + "storage": "", + "storage_type": "", + "tablet": true, + "tags": "", + "target_node": "uffizi", + "timeouts": null, + "unused_disk": [], + "vcpus": 0, + "vga": [], + "vlan": -1, + "vmid": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlZmF1bHQiOjMwMDAwMDAwMDAwMCwiZGVsZXRlIjoxODAwMDAwMDAwMDAsInJlYWQiOjE4MDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "rancher2_cluster.staging-workers" + ] + } + ] + }, + { + "module": "module.elastic-worker2", + "mode": "managed", + "type": "proxmox_vm_qemu", + "name": "node", + "provider": "module.elastic-worker2.provider[\"registry.terraform.io/telmate/proxmox\"]", + "instances": [ + { + "status": "tainted", + "schema_version": 0, + "attributes": { + "additional_wait": 0, + "agent": 0, + "args": "", + "balloon": 1024, + "bios": "seabios", + "boot": "c", + "bootdisk": "", + "bridge": "", + "ci_wait": null, + "cicustom": "", + "cipassword": "", + "ciuser": "root", + "clone": "debian-bullseye-11.3-zfs-2022-04-21", + "clone_wait": 0, + "cloudinit_cdrom_storage": null, + "cores": 4, + "cpu": "kvm64", + "default_ipv4_address": null, + "define_connection_info": true, + "desc": "elastic worker running in rancher cluster", + "disk": [ + { + "backup": 0, + "cache": "none", + "discard": "", + "file": "base-10008-disk-0/vm-148-disk-0", + "format": "raw", + "iothread": 0, + "mbps": 0, + "mbps_rd": 0, + "mbps_rd_max": 0, + "mbps_wr": 0, + "mbps_wr_max": 0, + "media": "", + "replicate": 0, + "size": "20G", + "slot": 0, + "ssd": 0, + "storage": "proxmox", + "storage_type": "rbd", + "type": "virtio", + "volume": "proxmox:base-10008-disk-0/vm-148-disk-0" + }, + { + "backup": 0, + "cache": "none", + "discard": "", + "file": "vm-148-disk-1", + "format": "raw", + "iothread": 0, + "mbps": 0, + "mbps_rd": 0, + "mbps_rd_max": 0, + "mbps_wr": 0, + "mbps_wr_max": 0, + "media": "", + "replicate": 0, + "size": "50G", + "slot": 1, + "ssd": 0, + "storage": "proxmox", + "storage_type": "rbd", + "type": "virtio", + "volume": "proxmox:vm-148-disk-1" + } + ], + "disk_gb": 0, + "force_create": false, + "force_recreate_on_change_of": null, + "full_clone": false, + "guest_agent_ready_timeout": 100, + "hagroup": "", + "hastate": "", + "hotplug": "network,disk,usb", + "id": "uffizi/qemu/148", + "ipconfig0": "ip=192.168.130.132/24,gw=192.168.130.1", + "ipconfig1": "", + "ipconfig2": "", + "ipconfig3": "", + "ipconfig4": "", + "ipconfig5": "", + "iso": null, + "kvm": true, + "mac": "", + "memory": 4096, + "name": "elastic-worker2", + "nameserver": "192.168.100.29", + "network": [ + { + "bridge": "vmbr443", + "firewall": false, + "link_down": false, + "macaddr": "3E:A6:49:DA:D1:AC", + "model": "virtio", + "queues": 0, + "rate": 0, + "tag": -1 + } + ], + "nic": "", + "numa": false, + "onboot": true, + "oncreate": true, + "os_network_config": null, + "os_type": "cloud-init", + "pool": "", + "preprovision": true, + "qemu_os": "other", + "reboot_required": false, + "scsihw": "virtio-scsi-pci", + "searchdomain": "internal.staging.swh.network", + "serial": [], + "sockets": 1, + "ssh_forward_ip": null, + "ssh_host": null, + "ssh_port": null, + "ssh_private_key": null, + "ssh_user": "root", + "sshkeys": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVKCfpeIMg7GS3Pk03ZAcBWAeDZ+AvWk2k/pPY0z8MJ3YAbqZkRtSK7yaDgJV6Gro7nn/TxdJLo2jEzzWvlC8d8AEzhZPy5Z/qfVVjqBTBM4H5+e+TItAHFfaY5+0WvIahxcfsfaq70MWfpJhszAah3ThJ4mqzYaw+dkr42+a7Gx3Ygpb/m2dpnFnxvXdcuAJYStmHKU5AWGWWM+Fm50/fdMqUfNd8MbKhkJt5ihXQmZWMOt7ls4N8i5NZWnS9YSWow8X/ENOEqCRN9TyRkc+pPS0w9DNi0BCsWvSRJOkyvQ6caEnKWlNoywCmM1AlIQD3k4RUgRWe0vqg/UKPpH3Z root@terraform\n", + "storage": "", + "storage_type": "", + "tablet": true, + "tags": "", + "target_node": "uffizi", + "timeouts": null, + "unused_disk": [], + "vcpus": 0, + "vga": [], + "vlan": -1, + "vmid": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlZmF1bHQiOjMwMDAwMDAwMDAwMCwiZGVsZXRlIjoxODAwMDAwMDAwMDAsInJlYWQiOjE4MDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "rancher2_cluster.staging-workers" + ] + } + ] + }, { "module": "module.maven-exporter0", "mode": "managed", diff --git a/proxmox/terraform/versions.tf b/proxmox/terraform/versions.tf --- a/proxmox/terraform/versions.tf +++ b/proxmox/terraform/versions.tf @@ -1,5 +1,6 @@ terraform { required_version = ">= 0.13" + experiments = [module_variable_optional_attrs] required_providers { proxmox = { source = "telmate/proxmox" @@ -16,7 +17,7 @@ pm_tls_insecure = true pm_api_url = "https://beaubourg.internal.softwareheritage.org:8006/api2/json" # in a shell (see README): source ../setup.sh - + # Uncomment this section to activate the proxmox execution logs # pm_log_enable = true # pm_log_file = "terraform-plugin-proxmox.log"