Skip to content

Commit

Permalink
make sure CPU architecture is configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
pstadler committed Sep 21, 2023
1 parent bc5dfd1 commit 6fb7e60
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export TF_VAR_scaleway_secret_key=<secret_key>
# export TF_VAR_scaleway_zone="nl-ams-1"
# export TF_VAR_scaleway_type="DEV1-S"
# export TF_VAR_scaleway_image="Ubuntu 22.04 Jammy Jellyfish"

# export TF_VAR_scaleway_image_architecture="x86_64"
```

#### Using DigitalOcean as provider
Expand Down
19 changes: 10 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ module "provider" {
# module "provider" {
# source = "./provider/scaleway"
#
# organization_id = var.scaleway_organization_id
# access_key = var.scaleway_access_key
# secret_key = var.scaleway_secret_key
# zone = var.scaleway_zone
# type = var.scaleway_type
# image = var.scaleway_image
# hosts = var.node_count
# hostname_format = var.hostname_format
# organization_id = var.scaleway_organization_id
# access_key = var.scaleway_access_key
# secret_key = var.scaleway_secret_key
# zone = var.scaleway_zone
# type = var.scaleway_type
# image = var.scaleway_image
# image_architecture = var.scaleway_image_architecture
# hosts = var.node_count
# hostname_format = var.hostname_format
# }

# module "provider" {
Expand Down Expand Up @@ -68,7 +69,7 @@ module "provider" {

# module "provider" {
# source = "./provider/upcloud"
#
#
# username = var.upcloud_username
# password = var.upcloud_password
# hosts = var.node_count
Expand Down
6 changes: 5 additions & 1 deletion provider/scaleway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ variable "image" {
type = string
}

variable "image_architecture" {
type = string
}

variable "apt_packages" {
type = list(any)
default = []
Expand Down Expand Up @@ -64,7 +68,7 @@ resource "scaleway_instance_server" "host" {
}

data "scaleway_instance_image" "image" {
architecture = "x86_64"
architecture = var.image_architecture
name = var.image
}

Expand Down
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ variable "scaleway_image" {
default = "Ubuntu 22.04 Jammy Jellyfish"
}

variable "scaleway_image_architecture" {
default = "x86_64"
}

/* digitalocean */
variable "digitalocean_token" {
default = ""
Expand Down

0 comments on commit 6fb7e60

Please sign in to comment.