feat: initial commit
- have been working on this for some time now
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
provider "cobbler" {
|
||||
username = var.cobbler_username
|
||||
password = var.cobbler_password
|
||||
url = var.cobbler_url
|
||||
}
|
||||
|
||||
provider "puppetdb" {
|
||||
url = var.puppetdb_url
|
||||
ca = var.puppet_cert_ca
|
||||
cert = var.puppet_cert_pub
|
||||
key = var.puppet_cert_priv
|
||||
}
|
||||
|
||||
provider "puppetca" {
|
||||
url = var.puppetca_url
|
||||
ca = var.puppet_cert_ca
|
||||
cert = var.puppet_cert_pub
|
||||
key = var.puppet_cert_priv
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
variable "name" {
|
||||
description = "Name of the instance."
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "image" {
|
||||
description = "Base image from which the instance will be created."
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "description" {
|
||||
description = "Description of the instance."
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "type" {
|
||||
description = "Instance type. Can be 'container' or 'virtual-machine'."
|
||||
type = string
|
||||
default = "container"
|
||||
}
|
||||
|
||||
variable "ephemeral" {
|
||||
description = "Whether this instance is ephemeral."
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "running" {
|
||||
description = "Whether the instance should be started (running)."
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "wait_for" {
|
||||
description = <<EOT
|
||||
List of wait_for blocks. Each block should contain:
|
||||
- type: Type of wait (e.g., ipv4, ipv6)
|
||||
- nic: Network interface name (e.g., eth0)
|
||||
EOT
|
||||
type = list(object({
|
||||
type = string
|
||||
nic = string
|
||||
}))
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "profiles" {
|
||||
description = "List of Incus config profiles to apply to the instance. Use [] to apply none."
|
||||
type = list(string)
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "disk_devices" {
|
||||
description = <<EOT
|
||||
List of disk devices to attach to the instance. Each device must be:
|
||||
- name : Name of the device
|
||||
- type : Must be "disk"
|
||||
- properties : Must include at least 'path', 'source', and 'pool'
|
||||
EOT
|
||||
|
||||
type = list(object({
|
||||
name = string
|
||||
type = string
|
||||
properties = object({
|
||||
path = string
|
||||
source = string
|
||||
pool = string
|
||||
})
|
||||
}))
|
||||
|
||||
default = []
|
||||
|
||||
validation {
|
||||
condition = alltrue([for d in var.disk_devices : d.type == "disk"])
|
||||
error_message = "All devices must have type 'disk'."
|
||||
}
|
||||
}
|
||||
|
||||
variable "storage_volumes" {
|
||||
description = "Map of storage volumes to create and attach."
|
||||
type = map(object({
|
||||
pool = string
|
||||
description = optional(string)
|
||||
type = optional(string)
|
||||
content_type = optional(string)
|
||||
config = optional(map(string))
|
||||
path = string
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "cobbler_domain" {
|
||||
description = "Domain to assign in Cobbler for the system hostname"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "cobbler_profile" {
|
||||
description = "Cobbler OS profile to use"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "cobbler_netmask" {
|
||||
description = "Cobbler eth0 netmask to use"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "cobbler_name_servers" {
|
||||
description = "List of name servers for the Cobbler system"
|
||||
type = list(string)
|
||||
default = ["198.18.13.12", "198.18.13.13"]
|
||||
}
|
||||
|
||||
variable "cobbler_mgmt_classes" {
|
||||
description = "List of Cobbler management classes. Must contain exactly 1 item."
|
||||
type = list(string)
|
||||
default = ["roles::base"]
|
||||
|
||||
validation {
|
||||
condition = length(var.cobbler_mgmt_classes) == 1
|
||||
error_message = "You must provide exactly 1 Cobbler management class."
|
||||
}
|
||||
}
|
||||
|
||||
variable "cobbler_url" {
|
||||
description = "The URL to the Cobbler API"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "cobbler_username" {
|
||||
description = "The username for the Cobbler API"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "cobbler_password" {
|
||||
description = "The password for the Cobbler API"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "puppet_cert_ca" {
|
||||
description = "Puppet CA cert content"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "puppet_cert_pub" {
|
||||
description = "PuppetDB client cert content"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "puppet_cert_priv" {
|
||||
description = "PuppetDB client private key content"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "puppetdb_url" {
|
||||
description = "The URL of the PuppetPB API"
|
||||
type = string
|
||||
default = "https://puppetdbapi.query.consul:8081"
|
||||
}
|
||||
|
||||
variable "puppetca_url" {
|
||||
description = "The URL of the Puppet Certificate Authority (CA) server"
|
||||
type = string
|
||||
default = "https://puppetca.query.consul:8140"
|
||||
}
|
||||
|
||||
variable "check_on_instance_creation" {
|
||||
description = "If false, defer puppetca_certificate creation until instance is fully created."
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
Reference in New Issue
Block a user