GithubHelp home page GithubHelp logo

proxmox-infra's Introduction

proxmox-infra

Packer

Build the required ubuntu-basic VM image/template to be used to start other VMs with terraform.

Initial setup

It requires a packer@pve user in Proxmox. To create it:

$ pveum useradd packer@pve

$ pveum passwd packer@pve
Enter new password: ************
Retype new password: ************

$ pveum roleadd Packer -privs "VM.Config.Disk VM.Config.CPU VM.Config.Memory Datastore.AllocateSpace Sys.Modify VM.Config.Options VM.Allocate VM.Audit VM.Console VM.Config.CDROM VM.Config.Network VM.PowerMgmt VM.Config.HWType VM.Monitor SDN.Use VM.Config.Cloudinit"

$ pveum aclmod / -user packer@pve -role Packer

Running

$ set -x PROXMOX_USERNAME packer@pve
$ set -x PROXMOX_PASSWORD (pass Mkz/night-flight/packer@pve)

$ packer init -upgrade plugins.pkr.hcl

$ packer validate ubuntu-basic.pkr.hcl
The configuration is valid.

$ packer build ubuntu-basic.pkr.hcl
[...snip...]

Source: https://github.com/hashicorp/packer-plugin-proxmox

Terraform

Install & run VMs in proxmox.

Initial setup

$ pveum role add TerraformProv -privs "Datastore.AllocateSpace Datastore.Audit Pool.Allocate Sys.Audit Sys.Console Sys.Modify VM.Allocate VM.Audit VM.Clone VM.Config.CDROM VM.Config.Cloudinit VM.Config.CPU VM.Config.Disk VM.Config.HWType VM.Config.Memory VM.Config.Network VM.Config.Options VM.Migrate VM.Monitor VM.PowerMgmt"

$ pveum user add terraform-prov@pve --password <password>

$ pveum aclmod / -user terraform-prov@pve -role TerraformProv

Running

$ set -x TF_VAR_proxmox_url "https://10.0.0.7:8006/api2/json"
$ set -x TF_VAR_proxmox_token_id "terraform@pve!terraform"
$ set -x TF_VAR_proxmox_token_secret (pass Mkz/night-flight/terraform@pve)

$ terraform init
$ terrafrom validate
$ terraform plan
[...snip...]

$ terraform apply
[...snip...]

Don't forget to commit terraform.tfstate if change occurs.

proxmox-infra's People

Contributors

mycroft avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.