From ba34e8f9c7577ded12e5e8b230f923c78637378c Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 1 Feb 2021 21:17:08 +0100 Subject: [PATCH] WIP terraform file --- terraform/bench-tor-links/main.tf | 63 +++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 terraform/bench-tor-links/main.tf diff --git a/terraform/bench-tor-links/main.tf b/terraform/bench-tor-links/main.tf new file mode 100644 index 0000000..f9d7be8 --- /dev/null +++ b/terraform/bench-tor-links/main.tf @@ -0,0 +1,63 @@ +/********************** + * TOR EXIT + **********************/ +resource "scaleway_instance_ip" "torexit_ip" {} +resource "scaleway_instance_server" "torexit" { + type = "DEV1-L" + image = "ubuntu_focal" + name = "torexit" + cloud_init = <<-EOT +#!/bin/bash +wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash +systemctl start torexithelper.service +sleep 5 +for i in $(seq 1 8); do echo start $i ; systemctl start torexit@$i ; sleep 60 ; done +EOT + ip_id = scaleway_instance_ip.torexit_ip.id +} + +resource "scaleway_instance_ip" "torexitna_ip" {} +resource "scaleway_instance_server" "torexitna" { + type = "DEV1-L" + image = "ubuntu_focal" + name = "torexitna" + cloud_init = <<-EOT +#!/bin/bash +wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/install.sh?inline=false -O - | bash +systemctl start torexitnahelper.service +sleep 5 +for i in $(seq 1 8); do echo start $i ; systemctl start torexitna@$i ; sleep 60 ; done +EOT + ip_id = scaleway_instance_ip.torexitna_ip.id +} + + +/********************** + * TOR HIDDEN SERVICE + **********************/ +resource "scaleway_instance_ip" "torhs_ip" {} +resource "scaleway_instance_server" "torhs" { + type = "DEV1-L" + image = "ubuntu_focal" + name = "torhs" + 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" "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 +} +