fixed
This commit is contained in:
parent
83e2e8df1d
commit
4a903d5091
2 changed files with 47 additions and 25 deletions
|
|
@ -42,6 +42,7 @@ curl
|
||||||
# allow for ansible
|
# allow for ansible
|
||||||
python3
|
python3
|
||||||
python3-libselinux
|
python3-libselinux
|
||||||
|
qemu-guest-agent
|
||||||
|
|
||||||
# unnecessary firmware
|
# unnecessary firmware
|
||||||
-aic94xx-firmware
|
-aic94xx-firmware
|
||||||
|
|
@ -139,6 +140,9 @@ yum update -y
|
||||||
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
|
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
|
||||||
|
|
||||||
yum clean all
|
yum clean all
|
||||||
|
|
||||||
|
# enabling qemu-guest-tools
|
||||||
|
systemctl enable qemu-guest-agent
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%anaconda
|
%anaconda
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ variable "proxmox_iso_pool" {
|
||||||
|
|
||||||
variable "proxmox_node" {
|
variable "proxmox_node" {
|
||||||
type = string
|
type = string
|
||||||
default = "pve1"
|
default = "pve2"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "proxmox_password" {
|
variable "proxmox_password" {
|
||||||
|
|
@ -41,7 +41,7 @@ variable "proxmox_storage_pool_type" {
|
||||||
|
|
||||||
variable "proxmox_url" {
|
variable "proxmox_url" {
|
||||||
type = string
|
type = string
|
||||||
default = "https://192.168.1.51:8006/api2/json"
|
default = "https://pve2.lan.alcatrash.net:8006/api2/json"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "proxmox_username" {
|
variable "proxmox_username" {
|
||||||
|
|
@ -68,15 +68,16 @@ source "proxmox" "autogenerated_1" {
|
||||||
boot_command = ["<tab> text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/inst.ks<enter><wait>"]
|
boot_command = ["<tab> text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/inst.ks<enter><wait>"]
|
||||||
boot_wait = "10s"
|
boot_wait = "10s"
|
||||||
cores = "2"
|
cores = "2"
|
||||||
|
cpu_type = "host"
|
||||||
disks {
|
disks {
|
||||||
disk_size = "8G"
|
disk_size = "8G"
|
||||||
format = "${var.proxmox_storage_format}"
|
format = "${var.proxmox_storage_format}"
|
||||||
storage_pool = "${var.proxmox_storage_pool}"
|
storage_pool = "${var.proxmox_storage_pool}"
|
||||||
storage_pool_type = "${var.proxmox_storage_pool_type}"
|
storage_pool_type = "${var.proxmox_storage_pool_type}"
|
||||||
type = "scsi"
|
type = "scsi"
|
||||||
}
|
}
|
||||||
http_directory = "rocky8"
|
http_directory = "rocky8"
|
||||||
insecure_skip_tls_verify = true
|
insecure_skip_tls_verify = false
|
||||||
iso_file = "${var.proxmox_iso_pool}/${var.centos_image}"
|
iso_file = "${var.proxmox_iso_pool}/${var.centos_image}"
|
||||||
memory = "2048"
|
memory = "2048"
|
||||||
network_adapters {
|
network_adapters {
|
||||||
|
|
@ -85,28 +86,45 @@ source "proxmox" "autogenerated_1" {
|
||||||
model = "virtio"
|
model = "virtio"
|
||||||
firewall = false
|
firewall = false
|
||||||
}
|
}
|
||||||
node = "${var.proxmox_node}"
|
vga {
|
||||||
os = "l26"
|
type = "std"
|
||||||
password = "${var.proxmox_password}"
|
|
||||||
proxmox_url = "${var.proxmox_url}"
|
}
|
||||||
scsi_controller = "virtio-scsi-single"
|
node = "${var.proxmox_node}"
|
||||||
ssh_password = "${var.vm_password}"
|
os = "l26"
|
||||||
ssh_port = 22
|
password = "${var.proxmox_password}"
|
||||||
ssh_timeout = "30m"
|
proxmox_url = "${var.proxmox_url}"
|
||||||
ssh_username = "root"
|
scsi_controller = "virtio-scsi-single"
|
||||||
template_description = "${var.template_description}"
|
ssh_password = "${var.vm_password}"
|
||||||
template_name = "${var.template_name}"
|
ssh_port = 22
|
||||||
unmount_iso = true
|
ssh_timeout = "30m"
|
||||||
username = "${var.proxmox_username}"
|
ssh_username = "root"
|
||||||
vm_id = 517
|
template_description = "${var.template_description}"
|
||||||
|
template_name = "${var.template_name}"
|
||||||
|
unmount_iso = true
|
||||||
|
username = "${var.proxmox_username}"
|
||||||
|
vm_id = 517
|
||||||
|
cloud_init = true
|
||||||
|
cloud_init_storage_pool = "${var.proxmox_storage_pool}"
|
||||||
}
|
}
|
||||||
|
|
||||||
build {
|
build {
|
||||||
sources = ["source.proxmox.autogenerated_1"]
|
sources = ["source.proxmox.autogenerated_1"]
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = ["yum install -y cloud-init qemu-guest-agent cloud-utils-growpart gdisk", "shred -u /etc/ssh/*_key /etc/ssh/*_key.pub", "rm -f /var/run/utmp", ">/var/log/lastlog", ">/var/log/wtmp", ">/var/log/btmp", "rm -rf /tmp/* /var/tmp/*", "unset HISTFILE; rm -rf /home/*/.*history /root/.*history", "rm -f /root/*ks", "passwd -d root", "passwd -l root"]
|
inline = [
|
||||||
only = ["proxmox"]
|
"yum install -y cloud-init qemu-guest-agent cloud-utils-growpart gdisk",
|
||||||
|
"shred -u /etc/ssh/*_key /etc/ssh/*_key.pub",
|
||||||
|
"rm -f /var/run/utmp",
|
||||||
|
">/var/log/lastlog",
|
||||||
|
">/var/log/wtmp",
|
||||||
|
">/var/log/btmp",
|
||||||
|
"rm -rf /tmp/* /var/tmp/*",
|
||||||
|
"unset HISTFILE; rm -rf /home/*/.*history /root/.*history",
|
||||||
|
"rm -f /root/*ks"
|
||||||
|
# "passwd -d root",
|
||||||
|
# "passwd -l root"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue