Skip to content

O1ahmad/cloud-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible logo

Cloud-Node

GitHub release (latest by date) License: MIT

Provision a node across the various cloud infrastructure providers with security best practices.

Requirements

-

Role Variables

Common Variables

var description default
cloud_provider Cloud provider to use for resource management aws
cloud_location Cloud region where resources will be deployed us-east-1
cloud_user User for SSH and instance management ubuntu
instance_name Name of the instance default-instance
instance_type Instance type for the deployment t2.micro (AWS), n1-standard-1 (GCP), Standard_B1s (Azure), s-1vcpu-1gb (DO)
instance_image Instance image for the deployment ami-0e001c9271cf7f3b9
instance_tag Tag for the instance and security group
storage_size Storage size for the instance in GB 30
public_ip Whether to assign a public IP to the instance true
ssh_private_key_path Path to the SSH private key for the instance ~/.ssh/default
ssh_public_key SSH public key or keypair for the Cloud instance ~/.ssh/default.pub
wait_for_ssh Whether to wait for SSH to become available during setup true
ingress_ports List of ingress ports and protocols for the security group [{ protocol: 'tcp', port: 22, cidr: '0.0.0.0/0' }]
security_group_name Name of the security group to create default-security-group
security_group_description Description for the security group Default Security Group
uninstall Whether to uninstall/remove the created resources false

AWS Specific Variables

Environment Variables

To authorize access to your AWS resources, set the following environment variables:

export AWS_ACCESS_KEY_ID=<your-access-key-id>
export AWS_SECRET_ACCESS_KEY=<your-secret-access-key>

GCP Specific Variables

var description default
gcp_project GCP project ID

Environment Variables

To authorize access to your GCP resources, set the following environment variable:

export GCP_AUTH_KIND=serviceaccount
export GCP_SERVICE_ACCOUNT_FILE=<path-to-your-service-account-json>

Azure Specific Variables

var description default
resource_group Azure resource group
vnet_name Name of the Azure virtual network
subnet_name Name of the Azure subnet
public_ip_name Name of the Azure public IP address
nic_name Name of the Azure network interface

Environment Variables

To authorize access to your Azure resources, set the following environment variables:

export AZURE_SUBSCRIPTION_ID=<your-subscription-id>
export AZURE_CLIENT_ID=<your-client-id>
export AZURE_SECRET=<your-secret>
export AZURE_TENANT=<your-tenant-id>

DigitalOcean Specific Variables

var description default
do_ssh_key_fingerprint SSH key fingerprint for the droplet

Environment Variables

To authorize access to your DigitalOcean resources, set the following environment variable:

export DO_API_TOKEN=<your-api-token>

Dependencies

roles: None
collections:
- amazon.aws
- azure.azcollection
- community.digitalocean
- google.cloud

Example Playbook

- hosts: localhost
  roles:
  • Provision a t3.micro EC2 instance:
  - role: ./cloud-node
    vars:
      cloud_provider: aws
      image: ami-0e001c9271cf7f3b9
      instance: "t3.micro"

License

MIT

Author Information

This Ansible role was created in 2024 by O1.IO.

🏆 always happy to help & donations are always welcome 💸

  • ETH (Ethereum): 0x652eD9d222eeA1Ad843efec01E60C29bF2CF6E4c

  • BTC (Bitcoin): 3E8gMxwEnfAAWbvjoPVqSz6DvPfwQ1q8Jn

  • ATOM (Cosmos): cosmos19vmcf5t68w6ug45mrwjyauh4ey99u9htrgqv09

About

A template for provisioning a set of compute nodes across cloud providers

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages