Skip to content

Instantly share code, notes, and snippets.

@Dzibeul
Created July 18, 2023 12:04
Show Gist options
  • Save Dzibeul/d34f669f632a61ff6454bd172b868d8b to your computer and use it in GitHub Desktop.
Save Dzibeul/d34f669f632a61ff6454bd172b868d8b to your computer and use it in GitHub Desktop.
variable "ak" {
type = string
default = "${env("OSC_OMI_ACCESS_KEY")}"
}
variable "osc_omi_username" {
type = string
default = "${env("OSC_OMI_USERNAME")}"
}
variable "ows_internal_username" {
type = string
default = "${env("OWS_INTERNAL_USERNAME")}"
}
variable "region" {
type = string
default = "${env("REGION")}"
}
variable "sk" {
type = string
default = "${env("OSC_OMI_SECRET_KEY")}"
}
variable "ssh_username" {
type = string
default = "outscale"
}
source "outscale-bsu" "cgw" {
access_key = "${var.ak}"
force_deregister = true
insecure_skip_tls_verify = true
omi_name = "cgw_rocky_8"
region = "${var.region}"
secret_key = "${var.sk}"
source_omi_filter {
filters = {
image-name = "RockyLinux-8-2022.01.18-0"
}
owners = ["${var.osc_omi_username}"]
}
ssh_interface = "public_ip"
ssh_username = "${var.ssh_username}"
vm_type = "tinav2.c2r4p1"
}
build {
sources = ["source.outscale-bsu.cgw"]
provisioner "file" {
destination = "/tmp"
source = "files"
}
provisioner "file" {
destination = "/tmp"
source = "scripts"
}
provisioner "shell" {
inline = ["chmod +x /tmp/scripts/*.sh && for i in /tmp/scripts/*.sh; do sudo -E $i; done"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment