v.1.0
This commit is contained in:
17
proxmox/cloud12.sh
Executable file
17
proxmox/cloud12.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
OSV="12"
|
||||
export VMCIID="912"
|
||||
FILE="debian-$OSV-genericcloud-amd64.qcow2"
|
||||
wget https://cloud.debian.org/images/cloud/bookworm/latest/$FILE
|
||||
FILETS=$(ls -lh debian-$OSV-genericcloud-amd64.qcow2 | cut -c 24-)
|
||||
timestamp=$(date)
|
||||
|
||||
qm create $VMCIID --name debian$OSV-cloudinit --memory 512 --net0 virtio,bridge=vmbr0 --ostype l26 --agent 1 --protection 0 --tags template
|
||||
qm importdisk $VMCIID $FILE local --format qcow2
|
||||
qm set $VMCIID --scsihw virtio-scsi-single --scsi0 local:$VMCIID/vm-$VMCIID-disk-0.qcow2
|
||||
qm set $VMCIID --boot c --bootdisk scsi0
|
||||
qm set $VMCIID --ide0 local:cloudinit
|
||||
qm set $VMCIID --serial0 socket --vga serial0
|
||||
qm set $VMCIID --description "Created by: cloud$OSV.sh<br>debian $OSV cloud-init template:<br>$FILETS<br>Deployed: $timestamp"
|
||||
qm template $VMCIID
|
17
proxmox/cloud13.sh
Executable file
17
proxmox/cloud13.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
OSV="13"
|
||||
export VMCIID="913"
|
||||
FILE="debian-$OSV-genericcloud-amd64.qcow2"
|
||||
wget https://cloud.debian.org/images/cloud/trixie/latest/$FILE
|
||||
FILETS=$(ls -lh debian-$OSV-genericcloud-amd64.qcow2 | cut -c 24-)
|
||||
timestamp=$(date)
|
||||
|
||||
qm create $VMCIID --name debian$OSV-cloudinit --memory 512 --net0 virtio,bridge=vmbr0 --ostype l26 --agent 1 --protection 0 --tags template
|
||||
qm importdisk $VMCIID $FILE local --format qcow2
|
||||
qm set $VMCIID --scsihw virtio-scsi-single --scsi0 local:$VMCIID/vm-$VMCIID-disk-0.qcow2
|
||||
qm set $VMCIID --boot c --bootdisk scsi0
|
||||
qm set $VMCIID --ide0 local:cloudinit
|
||||
qm set $VMCIID --serial0 socket --vga serial0
|
||||
qm set $VMCIID --description "Created by: cloud$OSV.sh<br>debian $OSV cloud-init template:<br>$FILETS<br>Deployed: $timestamp"
|
||||
qm template $VMCIID
|
9
proxmox/setup-vm.yml
Normal file
9
proxmox/setup-vm.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
#cloud-config
|
||||
runcmd:
|
||||
- apt update
|
||||
- apt install -y qemu-guest-agent mc
|
||||
- apt clean
|
||||
- systemctl start qemu-guest-agent
|
||||
- mkswap /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1
|
||||
- swapon /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1
|
||||
- echo '/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 none swap sw 0 0' >> /etc/fstab
|
6
proxmox/useradd.sh
Executable file
6
proxmox/useradd.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
pveum role add TerraformRole -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 SDN.Use"
|
||||
pveum user add terraform@pve
|
||||
pveum aclmod / -user terraform@pve -role TerraformRole
|
||||
pveum user token add terraform@pve tf --privsep 0
|
Reference in New Issue
Block a user