added some more points to readme, corrected a few typos

parent 09a73e8e
### Pre-requisites
### Prerequisites
- Internal DNS and DHCP
- Proxmox VE 6.x host (tested on PVE 6.1-8)
- Linux control host - to run Terraform, Ansible and SSH connection to Proxmox and virtual machines
- SSH with key pair authentication to Proxmox host - [Generate SSH key pair](#generate-ssh-key-pair)
- SSH with key pair authentication to Proxmox host and guest VMs - [Generate SSH key pair](#generate-ssh-key-pair)
- Terraform binaries - i.e. [Download](https://www.terraform.io/downloads.html) binary and copy to `/usr/bin/`
- Ansible - i.e. `sudo apt install ansible`
- Cloud-init template - [Create cloud-init template](#create-cloud-init-template)
......@@ -17,22 +17,31 @@
### To get started
**Make sure all pre-requisites are met or configured correctly**
**Make sure all prerequisites are met or configured correctly**
- Clone this repository `git clone [email protected]:itnoobs-automation/packer/proxmox-template.git`
- Run `az login` and sign into your account
- Change `pm_api_url` value to match your environment
- Change `pm_api_url` value in main.tf to match your environment
- Change directory, `cd proxmox-template`
- Run
- `terraform init` There should be no errors
- `terraform plan -out plan` Review, change and re-run as required
- `terraform apply plan`
### Generate SSH key pair
- Generate key pair `ssh-keygen`
- Add public key to the remote host `ssh-copy-id -i ~/.ssh/id_rsa.pub <username>@<hostname>`
- Add private key to SSH session ```eval `ssh-agent` && ssh-add -i ~/.ssh/id_rsa```
- Log in without password authentication `ssh <username>@<hostname>`
### Create cloud-init template
**Follow the official Proxmox [documentation](https://pve.proxmox.com/wiki/Cloud-Init_Support)**
Example below creates a cloud-init template from latest Ubuntu 20.04 image:
Create cloud-init template from latest Ubuntu 20.04 image:
- copy the link to the latest Ubuntu cloud-init image file http://cloud-images.ubuntu.com/focal/current/
- SSH into your Proxmox host
......@@ -46,31 +55,25 @@ Example below creates a cloud-init template from latest Ubuntu 20.04 image:
- `qm set 9000 --boot c --bootdisk virtio0`
- `qm set 9000 --serial0 socket`
- `qm template 9000`
- Add username, password, SSH public key, DNS domain name, DNS servers and IP config via web portal
### Generate SSH key pair
Example below generate SSH key pair and installs public key on remote host:
- Generate key pair `ssh-keygen`
- Add public key to the remote host `ssh-copy-id -i ~/.ssh/id_rsa.pub <username>@<hostname>`
- Add private key to SSH session ```eval `ssh-agent` && ssh-add -i ~/.ssh/id_rsa```
- Log in without password authentication `ssh <username>@<hostname>`
### Install Terraform provider and plugin
**Follow the official [documentation](https://github.com/Telmate/terraform-provider-proxmox/blob/master/docs/installation.md)**
For example you can do this on Ubuntu:
Build the binaries on Ubuntu:
- Install Go `sudo apt install go`
- Install build tools `sudo apt install build-essential`
- Clone provider repository `git clone https://github.com/Telmate/terraform-provider-proxmox.git`
- Change directory `cd terraform-provider-proxmox`
- Run:
- `go install github.com/Telmate/terraform-provider-proxmox/cmd/terraform-provider-proxmox`
- `go install github.com/Telmate/terraform-provider-proxmox/cmd/terraform-provisioner-proxmox`
- `make`
- Make plugin directory in **proxmox-template** `mkdir -p ~/.terraform.d/plugins`
- Make plugin directory in **proxmox-template** `mkdir -p ~/proxmox-template/.terraform.d/plugins`
- Copy provider and plugin binaries to the above directory
- `cp bin/terraform-provider-proxmox ~/.terraform.d/plugins`
- `cp bin/terraform-provisioner-proxmox ~/.terraform.d/plugins`
- `cp bin/terraform-provider-proxmox ~/proxmox-template/.terraform.d/plugins`
- `cp bin/terraform-provisioner-proxmox ~/proxmox-template/.terraform.d/plugins`
- Run `terraform init`
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment