<commit_before>variable "organization" {}

variable "token" {}

variable "hosts" {
  default = 0
}

variable "hostname_format" {
  type = "string"
}

variable "region" {
  type    = "string"
  default = "ams1"
}

variable "type" {
  type    = "string"
  default = "VC1S"
}

variable "image" {
  type    = "string"
  default = "Ubuntu Xenial"
}

variable "apt_packages" {
  type    = "list"
  default = []
}

# variable "storage_size" {
#   default = 50
# }

provider "scaleway" {
  organization = "${var.organization}"
  token        = "${var.token}"
  region       = "${var.region}"
}

resource "scaleway_server" "host" {
  name                = "${format(var.hostname_format, count.index + 1)}"
  type                = "${var.type}"
  image               = "${data.scaleway_image.image.id}"
  bootscript          = "${data.scaleway_bootscript.bootscript.id}"
  dynamic_ip_required = true

  count = "${var.hosts}"

  # volume = {
  #   size_in_gb = "${var.storage_size}"
  #   type       = "l_ssd"
  # }

  provisioner "remote-exec" {
    inline = [
      "apt-get update",
      "apt-get install -yq apt-transport-https ufw ${join(" ", var.apt_packages)}",
    ]
  }
}

data "scaleway_image" "image" {
  architecture = "x86_64"
  name         = "${var.image}"
}

data "scaleway_bootscript" "bootscript" {
  architecture = "x86_64"
  name_filter  = "4.10.8 std #1"
}

output "hostnames" {
  value = ["${scaleway_server.host.*.name}"]
}

output "public_ips" {
  value = ["${scaleway_server.host.*.public_ip}"]
}

output "private_ips" {
  value = ["${scaleway_server.host.*.private_ip}"]
}

output "private_network_interface" {
  value = "eth0"
}
<commit_msg>Update scaleway bootscript, fixes #20 (#21)<commit_after>variable "organization" {}

variable "token" {}

variable "hosts" {
  default = 0
}

variable "hostname_format" {
  type = "string"
}

variable "region" {
  type    = "string"
  default = "ams1"
}

variable "type" {
  type    = "string"
  default = "VC1S"
}

variable "image" {
  type    = "string"
  default = "Ubuntu Xenial"
}

variable "apt_packages" {
  type    = "list"
  default = []
}

# variable "storage_size" {
#   default = 50
# }

provider "scaleway" {
  organization = "${var.organization}"
  token        = "${var.token}"
  region       = "${var.region}"
}

resource "scaleway_server" "host" {
  name                = "${format(var.hostname_format, count.index + 1)}"
  type                = "${var.type}"
  image               = "${data.scaleway_image.image.id}"
  bootscript          = "${data.scaleway_bootscript.bootscript.id}"
  dynamic_ip_required = true

  count = "${var.hosts}"

  # volume = {
  #   size_in_gb = "${var.storage_size}"
  #   type       = "l_ssd"
  # }

  provisioner "remote-exec" {
    inline = [
      "apt-get update",
      "apt-get install -yq apt-transport-https ufw ${join(" ", var.apt_packages)}",
    ]
  }
}

data "scaleway_image" "image" {
  architecture = "x86_64"
  name         = "${var.image}"
}

data "scaleway_bootscript" "bootscript" {
  architecture = "x86_64"
  name_filter  = "mainline 4.15.11 rev1"
}

output "hostnames" {
  value = ["${scaleway_server.host.*.name}"]
}

output "public_ips" {
  value = ["${scaleway_server.host.*.public_ip}"]
}

output "private_ips" {
  value = ["${scaleway_server.host.*.private_ip}"]
}

output "private_network_interface" {
  value = "eth0"
}

{'fraction_non_alphanumeric': 0.16686531585220502, 'fraction_numerical': 0.013408820023837902, 'mean_word_length': 2.8675115207373274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2851883', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1234, 'n_words': 233}