add Makefile, gitignore, and basic README

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-03-31 19:28:28 +02:00
parent 88e606ae95
commit a04940c133
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
3 changed files with 65 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
.terraform/
.terraform.lock.hcl
*.tfstate
*.tfstate.d/
*.tfstate.backup
*.retry
ansible/files/*
__pycache__

49
Makefile Normal file
View File

@ -0,0 +1,49 @@
OS = $(strip $(shell uname -s))
ifeq ($(OS),Darwin)
ARCH = darwin_amd64
PROVISIONER_SHA1 = bd688a503f526beedaf6ef5d2dba1128051573b6
else
ARCH = linux_amd64
PROVISIONER_SHA1 = da9cdf019d8f860a6e417257d81b1b21aceba7b7
endif
TF_PLUGINS_DIR = $(HOME)/.terraform.d/plugins
PROVISIONER_NAME = terraform-provisioner-ansible
PROVISIONER_VERSION = v2.5.0
PROVISIONER_ARCHIVE = $(PROVISIONER_NAME)-$(subst _,-,$(ARCH))_$(PROVISIONER_VERSION)
PROVISIONER_URL = https://github.com/radekg/terraform-provisioner-ansible/releases/download/$(PROVISIONER_VERSION)/$(PROVISIONER_ARCHIVE)
PROVISIONER_PATH = $(TF_PLUGINS_DIR)/$(ARCH)/$(PROVISIONER_NAME)_$(PROVISIONER_VERSION)
all: requirements install-provisioner secrets init-terraform
@echo "Success!"
requirements-install:
ansible-galaxy install --keep-scm-meta --ignore-errors --force -r ansible/requirements.yml
requirements-check:
ansible/versioncheck.py
requirements: requirements-install requirements-check
$(PROVISIONER_PATH):
@mkdir -p $(TF_PLUGINS_DIR)/$(ARCH); \
wget -q $(PROVISIONER_URL) -O $(PROVISIONER_PATH); \
chmod +x $(PROVISIONER_PATH); \
install-provisioner: $(PROVISIONER_PATH)
@echo "$(PROVISIONER_SHA1) $(PROVISIONER_PATH)" | shasum -c \
|| rm -v $(PROVISIONER_PATH)
secrets:
pass services/consul/ca-crt > ansible/files/consul-ca.crt
pass services/consul/ca-key > ansible/files/consul-ca.key
pass services/consul/client-crt > ansible/files/consul-client.crt
pass services/consul/client-key > ansible/files/consul-client.key
init-terraform:
terraform init -upgrade=true
cleanup:
rm -r $(TF_PLUGINS_DIR)/$(ARCHIVE)

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# Description
This repo defines infrastructure for Codex fleet running [nim-dagger](https://github.com/status-im/nim-dagger) nodes.
# Repo Usage
For how to use this repo read the [Infra Repo Usage](https://github.com/status-im/infra-docs/blob/master/articles/infra_repo_usage.md) doc.