This module sets up a Nervos mining pool on Alibaba Cloud with terraform. It uses an Ansible role to configure a node with docker and run a btcpool docker-compose setup.
For AWS, check github organization.
- Terraform v0.12.0+
- Ansible - v2.9+ -
pip install ansible
- Python
- Submodules (nothing to install)
Install terraform v0.13+, get Alibaba credentials, clone this repository and cd into it.
# Create ssh keys and take note of path
ssh-keygen -b 4096
# Modify the terraform.tfvars and remove comments ('//')
nano terraform.tfvars
terraform init
terraform apply
provider "alicloud" {
region = var.alicloud_region
}
module "defaults" {
source = "github.com/insight-nervos/terraform-btcpool-alibaba-node"
vpc_name = var.vpc_name
num_azs = 2
root_volume_size = "50"
create_eip = true
public_key = file(var.public_key_path)
}
For more advanced configurations,
No issue is creating limit on this module.
No requirements.
Name | Version |
---|---|
alicloud | n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
all_enabled | Bool to enable all the security groups | bool |
false |
no |
assign_public_ip | Bool to enable assignment of public IP address. Overridden by create_eip. | bool |
true |
no |
azs | List of availability zones | list(string) |
[] |
no |
bastion_enabled | Boolean to enable a bastion host. All ssh traffic restricted to bastion | bool |
false |
no |
bastion_ip | Optional IP for bastion - blank for no bastion | string |
"" |
no |
bastion_sg_name | Name for the bastion security group | string |
"bastion-sg" |
no |
bastion_user | Optional bastion user - blank for no bastion | string |
"" |
no |
btcpool_env_file_path | Path to .env file for deployment | string |
"" |
no |
cidr | The cidr range for network | string |
"10.0.0.0/16" |
no |
corporate_ip | The corporate IP you want to restrict ssh traffic to | string |
"" |
no |
create | Boolean to make module or not | bool |
true |
no |
create_dns | Bool to create ssl cert and nginx proxy | bool |
true |
no |
create_eip | Bool to create and attach EIP to instance | bool |
true |
no |
create_private_subnets | Bool to enable creation of private subnets | bool |
false |
no |
domain_name | The domain - example.com. Blank for no ssl / nginx | string |
"" |
no |
enable_btcpool_ssl | Bool to enable SSL | bool |
false |
no |
hostname | The hostname - ie hostname.example.com - blank for example.com | string |
"" |
no |
instance_cpu_cores | Instance CPU cores | string |
"2" |
no |
instance_family | Instance family | string |
"ecs.g6" |
no |
instance_memory | Instance memory (in GB) | string |
"8" |
no |
key_name | The key pair to import - leave blank to generate new keypair from pub/priv ssh key path | string |
"" |
no |
name | The name for the label | string |
"btcpool" |
no |
node_name | Name of the node | string |
"" |
no |
node_sg_name | Name for the node security group | string |
"node-sg" |
no |
num_azs | The number of AZs to deploy into | number |
1 |
no |
playbook_vars | Additional playbook vars | map(string) |
{} |
no |
private_key_path | Path to private key | string |
"" |
no |
public_key_path | The path to the public ssh key | string |
"" |
no |
public_ports | List of publicly open ports | list(number) |
[ |
no |
root_volume_size | Root volume size | string |
"20" |
no |
stack_type | The type of stack to deploy - | string |
"prometheus" |
no |
suffix | Suffix to attach to name | string |
"" |
no |
tags | Map of tags | map(string) |
{} |
no |
Name | Description |
---|---|
bastion_security_group_id | The ID of the Bastion security group |
instance_id | The Alicloud ID of the instance |
key_name | The name of the SSH key |
node_security_group_id | The ID of the instance security group |
private_vswitch_ids | The IDs of the Vswitches for the private subnets |
public_ip | The public IP of the instance |
public_vswitch_ids | The IDs of the Vswitches for the public subnets |
vpc_id | The ID of the VPC where the instance is deployed |
This module has been packaged with terratest tests
To run them:
- Install Go
- Run
make test-init
from the root of this repo - Run
make test
again from root
Module managed by Richard Mah
Apache 2 Licensed. See LICENSE for full details.