krestomatio / terraform-libvirt-fcos

Terraform module to quickly generate a virtual machine using Fedora CoreOS and Libvirt.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terraform module to quickly generate a virtual machine using Fedora CoreOS and Libvirt.

Dependencies

The following are the dependencies to create k3s cluster with this module:

Requirements

Name Version
terraform >= 1.2.0
ct 0.11.0
libvirt ~> 0.7

Providers

Name Version
ct 0.11.0
libvirt ~> 0.7

Modules

Name Source Version
butane_common_snippets krestomatio/butane-snippets/ct//modules/common 0.0.33

Resources

Name Type
libvirt_domain.node resource
libvirt_ignition.node resource
libvirt_volume.backup resource
libvirt_volume.data resource
libvirt_volume.log resource
libvirt_volume.root resource
ct_config.node data source

Inputs

Name Description Type Default Required
additional_disks An array of one or more disks to attach to the domain. See docs
list(
object(
{
volume_id = optional(string)
url = optional(string)
file = optional(string)
block_device = optional(string)
scsi = optional(bool)
wwn = optional(string)
}
)
)
[] no
additional_rpms Additional rpms to install during boot using rpm-ostree, along with any pre or post command
object(
{
cmd_pre = optional(list(string), [])
list = optional(list(string), [])
cmd_post = optional(list(string), [])
}
)
{
"cmd_post": [],
"cmd_pre": [],
"list": []
}
no
arch The architecture for the VM (probably x86_64 or i686), you normally won't need to set this unless you are building a special VM string null no
autostart Autostart with libvirt host bool true no
backup_volume Create backup volume bool true no
backup_volume_format Node default backup volume mount format string "qcow2" no
backup_volume_path Node default backup volume mount path string "/var/mnt/backup" no
backup_volume_pool Node default backup volume pool string null no
backup_volume_size Node default backup volume size in bytes number 21474836480 no
butane_snippets_additional Additional butane snippets list(string) [] no
cidr_ip_address CIDR IP Address. Ex: 192.168.1.101/24 string null no
cmdline Arguments to the kernel list(map(string)) [] no
cpu_mode Libvirt default cpu mode for VMs string "host-passthrough" no
data_volume Create data volume bool true no
data_volume_format Node default data volume mount format string "qcow2" no
data_volume_path Node default data volume mount path string "/var/mnt/data" no
data_volume_pool Node default data volume pool string null no
data_volume_size Node default data volume size in bytes number 21474836480 no
do_not_countme Disable Fedora CoreOS infrastructure count me feature bool true no
emulator The path of the emulator to use string null no
etc_hosts /etc/host list
list(
object(
{
ip = string
hostname = string
fqdn = string
}
)
)
null no
etc_hosts_extra /etc/host extra block string null no
firmware The UEFI rom images for exercising UEFI secure boot in a qemu environment. string null no
fqdn Node FQDN string n/a yes
ignition_pool Default ignition files pool string null no
interface_name Network interface name string null no
keymap Keymap string null no
libosinfo_id Id for libosinfo/os type. See https://gitlab.com/libosinfo/osinfo-db/-/tree/main string "http://fedoraproject.org/coreos/stable" no
log_volume Create log volume bool true no
log_volume_format Node default log volume mount format string "qcow2" no
log_volume_path Node default log volume mount path string "/var/log" no
log_volume_pool Node default log volume pool string null no
log_volume_size Node default log volume size in bytes number 5368709120 no
mac Mac address string null no
machine The machine type, you normally won't need to set this unless you are running on a platform that defaults to the wrong machine type for your template string null no
memory Node default memory in MiB number 512 no
nameservers List of nameservers for VMs list(string)
[
"8.8.8.8"
]
no
network_bridge Libvirt default network bridge name for VMs string null no
network_id Libvirt default network id for VMs string null no
network_name Libvirt default network name for VMs string null no
nvram This block allows specifying the following attributes related to the nvram
object(
{
file = string
template = optional(string)

}
)
null no
periodic_updates Only reboot for updates during certain timeframes
{
time_zone = "localtime"
windows = [
{
days = ["Sat"],
start_time = "23:30",
length_minutes = "60"
},
{
days = ["Sun"],
start_time = "00:30",
length_minutes = "60"
}
]
}
object(
{
time_zone = optional(string, "")
windows = list(
object(
{
days = list(string)
start_time = string
length_minutes = string
}
)
)
}
)
null no
qemu_agent Install qemu guest agent bool true no
rollout_wariness Wariness to update, 1.0 (very cautious) to 0.0 (very eager) string null no
root_base_volume_name Node default base root volume name string n/a yes
root_base_volume_pool Node default base root volume pool string null no
root_volume_format Node default root volume mount format string "qcow2" no
root_volume_pool Node default root volume pool string null no
root_volume_size Node default root volume size in bytes number 21474836480 no
ssh_authorized_key Authorized ssh key for core user string n/a yes
sync_time_with_host Sync guest time with the kvm host bool null no
sysctl Additional kernel tuning in sysctl.d map(string)
{
"vm.swappiness": "0"
}
no
systemd_pager Systemd pager string "cat" no
timezone Timezone for VMs as listed by timedatectl list-timezones string null no
vcpu Node default vcpu count number 1 no
wait_for_lease Wait for network lease bool false no
xslt_snippet Snippet specifying XSLT to transform the generated XML definition before creating the domain. string "" no

Outputs

No outputs.

About Krestomatio

Krestomatio is a managed service for Moodle™ e-learning platforms. It allows you to have open-source instances managed by a service optimized for Moodle™, complete with an additional plugin pack and customization options.

About

Terraform module to quickly generate a virtual machine using Fedora CoreOS and Libvirt.

License:Apache License 2.0


Languages

Language:HCL 100.0%