imfreedom/bamboo-terraform
Clone
Summary
Browse
Changes
Graph
Lots of doc updates
draft
2019-05-27, Gary Kramlich
435e16a05f1c
Parents
7d921b9be0a8
Children
2f60a1721b1c
Lots of doc updates
1 files changed, 42 insertions(+), 10 deletions(-)
+42
-10
README.md
--- a/README.md Mon May 27 07:37:14 2019 -0500
+++ b/README.md Mon May 27 07:37:23 2019 -0500
@@ -1,13 +1,40 @@
# Pidgin Bamboo Terraform
-# Requirements
+This repository contains [terraform](https://www.terraform.io/) and
+[ansible](https://www.ansible.com/) scripts to configure the bamboo agents for
+[pidgin](https://pidgin.im).
-terraform and terraform-libvirt provider
+It will create a number of libvirt based virtual machines based on some
+configuration. These machines are a `cache` which will act as a caching proxy
+for both debian packages and docker containers. The other virtual machines are
+all workers. They will automatically be provisioned to talk to
+[bamboo](https://bamboo.pidgin.im) and have everything set up to work. The
+number of workers is configurable in the node's configuration which is
+documented below.
+
+# Setup
-# Terraform Host
+TLDR: install mkisofs, libvirt, [terraform](https://www.terraform.io/),
+[terraform-libvirt-provider](https://github.com/dmacvicar/terraform-provider-libvirt),
+and make sure the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment
+variables are properly set to the imfreedom [minio](https://data.imfreedom.org)
+instance.
+
+Terraform can be run from anywhere that this repository is cloned to with a few
+caveats. First you need to install [terraform](https://www.terraform.io/). I
+typically install it to `~/bin/`. Verify Terraform is installed and on your
+path by running `terraform version`.
-mkisofs and libvirt are needed on the machine where terraform is running for
-these plans to run properly.
+Once you have a working terraform install you need to install the
+[terraform-libvirt-provider](https://github.com/dmacvicar/terraform-provider-libvirt).
+This should be installed into `~/.terraform.d/plugins`.
+
+Next we need to make sure that `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
+environment variables are set to your credentials to the imfreedom
+[minio](https://data.imfreedom.org/) instance. If you need credentials, talk
+to grim. To make sure these environment variables are set, I recommend using
+[direnv](https://direnv.net/) and saving them to your `.envrc` in your clone.
+This file is already ignored in `.hgignore`
On Debian based hosts there is an apparmor policy that missing that will cause
permission errors. To fix it you need to add the following to
@@ -19,13 +46,15 @@
/var/lib/libvirt/images/* rwk,
```
-# Usage
+# Node Configuration
-You need to have a `node.tfvars` in the `nodes/` directory which has contents
-like the following.
+To actually terraform a node, we first need to create a `<node>.tfvars` in the
+`nodes/` directory. A bare minimal example is below. Please note that you
+are going to need an ssh key, and it is highly recommented that it has been
+added to your ssh agent.
```
-libvirt_uri = "qemu:///system"
+libvirt_uri = "qemu+ssh://host/system"
admin_ssh_pubkey = "ssh pubkey"
worker_count = 2
```
@@ -37,10 +66,13 @@
You can also use the `volume_pool` variable to use a different volume pool.
-Once that file is created you provision it via:
+Once that file is created you provision `nodes/node1.tfvars` via:
```
make plan NODE=node1
make apply NODE=node1
```
+Based on the number of workers, this can take quite a bit of time so make sure
+to run it in screen/tmux and maintain a stable internet connection.
+