From 280729edf6a9119efd2b884158df705dc1c293c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 21 Mar 2019 13:27:16 +0100 Subject: [PATCH] add master and regular nodes(1 for now) for nimbus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- ansible/main.yml | 7 ++++++- main.tf | 38 +++++++++++++++++++++++++++++++++++++- variables.tf | 7 +++++++ 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/ansible/main.yml b/ansible/main.yml index e96d4e9..b2587c1 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -4,7 +4,12 @@ roles: - origin-cert +#- name: Configure Nimbus master +# hosts: nimbus-master +# roles: +# - nimbus + - name: Configure Nimbus cluster - hosts: nimbus + hosts: nimbus-nodes roles: - nimbus diff --git a/main.tf b/main.tf index eb8db36..c904c07 100644 --- a/main.tf +++ b/main.tf @@ -37,4 +37,40 @@ terraform { /* RESOURCES ------------------------------------*/ -/* TODO */ +module "nimbus-master" { + source = "github.com/status-im/infra-tf-digital-ocean" + name = "master" + env = "nimbus" + group = "nimbus-master" + size = "s-4vcpu-8gb" + count = 1 + domain = "${var.domain}" + open_ports = [ + "80", /* HTTP */ + "443", /* HTTPS */ + "9630-9633", /* Nimbus ports */ + ] +} + +resource "cloudflare_record" "serenity-testnets" { + domain = "${var.public_domain}" + name = "serenity-testnets" + type = "A" + proxied = true + value = "${module.nimbus-master.public_ips[0]}" +} + +module "nimbus-nodes" { + source = "github.com/status-im/infra-tf-digital-ocean" + name = "node" + env = "nimbus" + group = "nimbus-slaves" + size = "s-4vcpu-8gb" + domain = "${var.domain}" + count = "${var.hosts_count}" + open_ports = [ + "80", /* HTTP */ + "443", /* HTTPS */ + "40404", /* peer connection */ + ] +} diff --git a/variables.tf b/variables.tf index bbd3b07..3554963 100644 --- a/variables.tf +++ b/variables.tf @@ -40,3 +40,10 @@ variable domain { description = "DNS Domain to update" default = "statusim.net" } + +/* RESOURCES ------------------------------------*/ + +variable hosts_count { + description = "Count of hosts in nimbus cluster" + default = 1 +}