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 +}