Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
rc
Packer Openstack Hpc Image
Commits
7542e18b
Commit
7542e18b
authored
Apr 29, 2022
by
Chris King
Browse files
Do a semi-dirty hack and provide a copy to stage a gpu image directly
parent
657cdd75
Changes
3
Hide whitespace changes
Inline
Side-by-side
openstack-gpu/README.md
0 → 100644
View file @
7542e18b
This contains packer hcl files for creating images. For documentation on packer, see
[
here
](
https://www.packer.io/docs
)
; for information about the openstack-specific builder, see
[
here
](
https://www.packer.io/plugins/builders/openstack
)
openstack-gpu/nodeimage.pkr.hcl
0 → 100644
View file @
7542e18b
locals {
local_image_name = "${var.image_name}${var.image_date_suffix ? formatdate("YYYYMMDDHHmm", timestamp()): ""}"
}
source "openstack" "image" {
image_name = local.local_image_name
source_image_name = var.source_image
flavor = var.flavor
floating_ip_network = var.floating_ip_network
networks = var.networks
security_groups = var.security_groups
ssh_username = var.ssh_username
}
# regular instance
build {
sources = ["source.openstack.image"]
provisioner "ansible" {
playbook_file = "./ansible/node-gpu.yml"
roles_path = "./ansible/roles"
extra_arguments = [
"--extra-vars", "root_ssh_key='${var.root_ssh_key}'"
]
}
}
openstack-gpu/variables.pkr.hcl
0 → 100644
View file @
7542e18b
variable "root_ssh_key" {
type = string
description = "The root key to use for ssh"
}
variable "image_name" {
type = string
default = "cluster-image-gpu"
description = "Name of the image in openstack"
}
variable "image_date_suffix" {
type = bool
default = false
description = "Append a date to the image name (in YYYYMMDDHHMMSS format)"
}
variable "source_image" {
type = string
description = "The name of the source image to use"
}
variable "flavor" {
type = string
description = "The name of the flavor to use"
}
variable "ssh_username" {
type = string
default = "centos"
description = "The default username to use for SSH"
}
variable "floating_ip_network" {
type = string
description = "floating ip network to use with (temporary) ip assignmnet to a vm"
}
variable "networks" {
type = list(string)
description = "List of network UUIDs to assign to the network"
}
variable "security_groups" {
type = list(string)
default = []
description = "A list of security groups to add - you should make sure ssh access is open to the machine"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment