Skip to content

A repo to keep infrastructure as code, and random scripts needed for our organization

Notifications You must be signed in to change notification settings

openoakland/infra

Repository files navigation

Infra

This repo is an experiment to apply the practices of Infrastructure as Code to OpenOakland. Why?

  • Inclusivity - Being transparent in our operations promotes collaboration and involvement of many.
  • Documentation - We will have documentation in source code about why infrastructure changes were made.
  • Sustainability - With better documentation and better participation, we will build a more sustainable organization.

Setup (macOS)

Note: If you are looking to set up the infra repo for your Brigade, see README.setup.md for how to set up the repo for the first time.

To run Terraform within OpenOakland, follow these instructions:

Prerequisites: Homebrew

# 1. Install Terraform
brew install [email protected] jq ansible

# 2. Install 1password command line tool
# from: https://app-updates.agilebits.com/product_history/CLI
op signin openoakland.1password.com [email] A3-[master-key]
eval $(op signin openoakland) # you will have to do this per shell

# Download the root SSH key
op get item 7rh246cuoreo3lurhxdtlf5b44 | jq -r .details.notesPlain > ~/.ssh/id_rsa_openoakland
chmod 600 ~/.ssh/id_rsa_openoakland

Secrets

TODO we should be able to get secrets from the terraform state without sharing secrets out of band.

Copy the .env sample and fill it in with secrets from another operator or the terraform state.

$ cp env.sample .env
$ source .env

Running

Terraform

terraform plan
terraform apply

You can also work with a specific module.

terraform plan -target=module.oakcrime -out=plan.tfplan
terraform apply plan.tfplan

Ansible

Running Ansible (Councilmatic):

ansible-playbook -i inventory playbooks/councilmatic/councilmatic.yml

TODO:

  • Create an SSH key which isn't anyone's personal key to use for provisioning a machine
  • Use Ansible or some kind of desired-state configuration so that all the setup isn't in terraform

Related resources

About

A repo to keep infrastructure as code, and random scripts needed for our organization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages