diff --git a/scripts/2021/main.tf b/scripts/2021/main.tf index b45a31b..bb87c3e 100644 --- a/scripts/2021/main.tf +++ b/scripts/2021/main.tf @@ -13,21 +13,83 @@ provider "scaleway" { project_id = "1915f95a-dea4-4222-8e6b-a90b6125d1f4" } +/********************** + * TOR HIDDEN SERVICE + **********************/ resource "scaleway_instance_ip" "torhs_ip" {} resource "scaleway_instance_server" "torhs" { type = "DEV1-L" image = "ubuntu_focal" name = "torhs" - cloud_init = file("${path.module}/torhs.init") + cloud_init = <<-EOT +#!/bin/bash +wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash +for i in $(seq 1 8); do echo start $i ; systemctl start torhs@$i ; sleep 60 ; done +EOT ip_id = scaleway_instance_ip.torhs_ip.id } - - resource "scaleway_instance_ip" "torhsopt_ip" {} resource "scaleway_instance_server" "torhsopt" { type = "DEV1-L" image = "ubuntu_focal" name = "torhsopt" - cloud_init = file("${path.module}/torhsopt.init") + cloud_init = <<-EOT +#!/bin/bash +wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash +for i in $(seq 1 8); do echo start $i ; systemctl start torhsopt@$i ; sleep 60 ; done +EOT ip_id = scaleway_instance_ip.torhsopt_ip.id } +resource "scaleway_instance_ip" "torhsna_ip" {} +resource "scaleway_instance_server" "torhsna" { + type = "DEV1-L" + image = "ubuntu_focal" + name = "torhsna" + cloud_init = <<-EOT +#!/bin/bash +wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash +for i in $(seq 1 8); do echo start $i ; systemctl start torhsna@$i ; sleep 60 ; done +EOT + ip_id = scaleway_instance_ip.torhsna_ip.id +} + +/********************** + * TORFONE + **********************/ +resource "scaleway_instance_ip" "torfone_ip" {} +resource "scaleway_instance_server" "torfone" { + type = "DEV1-L" + image = "ubuntu_focal" + name = "torfone" + cloud_init = <<-EOT +#!/bin/bash +wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash +for i in $(seq 1 8); do echo start $i ; systemctl start torfone@$i ; sleep 60 ; done +EOT + ip_id = scaleway_instance_ip.torfone_ip.id +} +resource "scaleway_instance_ip" "torfoneopt_ip" {} +resource "scaleway_instance_server" "torfoneopt" { + type = "DEV1-L" + image = "ubuntu_focal" + name = "torfoneopt" + cloud_init = <<-EOT +#!/bin/bash +wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash +for i in $(seq 1 8); do echo start $i ; systemctl start torfoneopt@$i ; sleep 60 ; done +EOT + ip_id = scaleway_instance_ip.torfoneopt_ip.id +} +resource "scaleway_instance_ip" "torfonena_ip" {} +resource "scaleway_instance_server" "torfonena" { + type = "DEV1-L" + image = "ubuntu_focal" + name = "torfonena" + cloud_init = <<-EOT +#!/bin/bash +wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash +for i in $(seq 1 8); do echo start $i ; systemctl start torfonena@$i ; sleep 60 ; done +EOT + ip_id = scaleway_instance_ip.torfonena_ip.id +} + diff --git a/scripts/2021/torhs.init b/scripts/2021/torhs.init deleted file mode 100644 index 9db4021..0000000 --- a/scripts/2021/torhs.init +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -apt-get update -y -qq -apt-get upgrade -y -qq -apt-get install -y ca-certificates wget -wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash -(for i in $(seq 1 8); do echo start $i ; systemctl start torhs@$i ; sleep 10 ; done) & -echo "done" diff --git a/scripts/2021/torhsopt.init b/scripts/2021/torhsopt.init deleted file mode 100644 index 744ed20..0000000 --- a/scripts/2021/torhsopt.init +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -apt-get update -y -qq -apt-get upgrade -y -qq -apt-get install -y ca-certificates wget -wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash -(for i in $(seq 1 8); do echo start $i ; systemctl start torhsopt@$i ; sleep 10 ; done) & -echo "done"