Coder Social home page Coder Social logo

accounttechnologies / using-terraform-rackspace-node-for-ansible Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8 KB

a simple example on how to user the terraform-rackspace-node-for-ansible to provision ansible inventory

License: Apache License 2.0

HCL 92.12% Shell 7.88%

using-terraform-rackspace-node-for-ansible's Introduction

using-terraform-rackspace-node-for-ansible

A simple example on how to user the terraform-rackspace-node-for-ansible to provision ansible inventory

This is a simple example which uses the terraform-rackspace-node-for-ansible module to provision nodes for an Ansible inventory file. It allows you to join both RackSpace and other servers into a single inventory for simple management.

There are a number of variables that need to be changed, these include those in the test.tfvars file (terraform --var-file) the location of the terraform-rackspace-node-for-ansible module in the main.tf file amoungst others

Basically each server goup is should be treated as a local module, such that

module "internal" {
  source                  = "./modules/terraform-rackspace-node-for-ansible"
  node_count              = "1"
  name_prefix             = "${var.cluster_prefix}-internal"
  flavor_name             = "${var.flavor_name}"
  image_name              = "${var.image_name}"
  networks                = [{name="private",uuid="11111111-1111-1111-1111-111111111111"},{name="${var.internal_network_name}",uuid="${var.internal_network_uuid}"}]
  internal_network_uuid   = "${var.internal_network_uuid}"
  ssh_user                = "${var.ssh_user}"
  ssh_key                 = "${var.ssh_key}"
  ssh_keypair             = "${var.ssh_keypair}"
  ssh_bastion_host        = module.external.servers[0].public_network_ip
  ssh_allow_ip            = module.external.servers[*].internal_network_ip
  ssh_alt_user            = module.external.servers[0].ssh_user
  roles                   = ["roleASlave","roleB"]
}

Describes a number (1 or more) servers which can be joined to similar roles, and what sort of infrastructure they require (networks etc) Local/Static servers not provisioned via Terraform can be added to the inventory via a locals.server_test variable in the main.tf file, which is added to the locals.servers variable. (any new roles need to be added into this)

This is then expanded into a inventory.yaml which can be tweaked, but simply groups servers into roles

You will need to

terraform init

and source the rackspace variables

rc.sh

and provision the nodes

terraform apply -var-file=test.tfvars

using-terraform-rackspace-node-for-ansible's People

Contributors

sendit2me avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.