summaryrefslogtreecommitdiff
path: root/acme
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2021-02-03 16:35:48 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2021-02-03 16:35:48 +0100
commitbafe762ac01d16904c18404283027e426e19bc73 (patch)
treec22688ad186f5ce635f525704c5035f91b983b68 /acme
parent91abd0b04320a9c9d932df195aca38c1cacfcc5a (diff)
downloadrules-sandbox-bafe762ac01d16904c18404283027e426e19bc73.tar.gz
rules-sandbox-bafe762ac01d16904c18404283027e426e19bc73.tar.bz2
rules-sandbox-bafe762ac01d16904c18404283027e426e19bc73.tar.xz
rules-sandbox-bafe762ac01d16904c18404283027e426e19bc73.zip
Code reorganization.
Moving main code to src, keeping modules in modules/
Diffstat (limited to 'acme')
-rw-r--r--acme/.gitignore9
-rw-r--r--acme/.settings.sh9
-rw-r--r--acme/Makefile41
-rw-r--r--acme/ansible.cfg8
-rw-r--r--acme/main.tf60
5 files changed, 0 insertions, 127 deletions
diff --git a/acme/.gitignore b/acme/.gitignore
deleted file mode 100644
index a01565a..0000000
--- a/acme/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-.terraform*
-terraform.d
-*.tfstate
-*.tfstate.backup
-plan
-
-.vault-password*
-*.dot
-*.png
diff --git a/acme/.settings.sh b/acme/.settings.sh
deleted file mode 100644
index 7bd49fb..0000000
--- a/acme/.settings.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-basedir=$(dirname "$_")
-basedir=$(cd "$basedir" && pwd)
-
-#echo "Adding tools/ to path"
-#PATH="$basedir/tools:$PATH"
-
-alias terraform="TF_VAR_ansible_vault_pass=\$($(pwd)/.vault-password) $(pwd)/.terraform/bin/terraform"
diff --git a/acme/Makefile b/acme/Makefile
deleted file mode 100644
index 39d54a6..0000000
--- a/acme/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-terraform_version=0.14.4
-terraform_url=https://releases.hashicorp.com/terraform/$(terraform_version)/terraform_$(terraform_version)_linux_amd64.zip
-terraform_unzip=.terraform/unzip/$(terraform_version)/
-terraform_zip=.terraform/zip/terraform_$(terraform_version)_linux_amd64.zip
-terraform_bin=.terraform/bin/terraform
-
-ansiblevault_version=2.0.1
-ansiblevault_url=https://github.com/MeilleursAgents/terraform-provider-ansiblevault/releases/download/v$(ansiblevault_version)/terraform-provider-ansiblevault_linux_amd64_v$(ansiblevault_version)
-ansiblevault_path=terraform.d/plugins/linux_amd64/terraform-provider-ansiblevault_v$(ansiblevault_version)_x4
-
-all: $(terraform_bin) $(ansiblevault_path) setup
-
-$(terraform_bin): $(terraform_zip)
- rm -rf $(dir $(terraform_unzip))
- mkdir -p $(terraform_unzip)
- mkdir -p $(dir $(terraform_bin))
- unzip $(terraform_zip) -d $(terraform_unzip)
- ln -sf $(PWD)/$(terraform_unzip)/terraform $(terraform_bin)
- touch $(PWD)/$(terraform_unzip)/terraform
-
-$(terraform_zip):
- mkdir -p $(dir $@)
- curl -L -o "$@" $(terraform_url)
-
-$(ansiblevault_path): terraform.d
- mkdir -p $(dir $@)
- curl -L -o "$@" $(ansiblevault_url)
- chmod +x $(@)
-
-terraform.d:
- mkdir $@
-
-MAIN=$(patsubst %/main.tf,%,$(wildcard */main.tf))
-setup: $(patsubst %,%/terraform.d,$(MAIN))
-.PHONY: setup
-
-%/terraform.d: terraform.d
- ln -s ../terraform.d $@
-
-.terraform/plugins/linux_amd64:
- mkdir -p $@
diff --git a/acme/ansible.cfg b/acme/ansible.cfg
deleted file mode 100644
index 1790523..0000000
--- a/acme/ansible.cfg
+++ /dev/null
@@ -1,8 +0,0 @@
-[defaults]
-become_method = sudo
-inventory = inventory.yml
-nocows = True
-stdout_callback = debug
-vault_password_file = .vault-password
-roles_path = roles
-retry_files_enabled = False
diff --git a/acme/main.tf b/acme/main.tf
deleted file mode 100644
index c7b91b2..0000000
--- a/acme/main.tf
+++ /dev/null
@@ -1,60 +0,0 @@
-terraform {
- required_providers {
- scaleway = {
- source = "scaleway/scaleway"
- version = "1.17.2"
- }
-
- ansiblevault = {
- source = "MeilleursAgents/ansiblevault"
- version = "2.2.0"
- }
- }
-}
-
-variable "ansible_vault_pass" {
- type = string
-}
-
-provider "ansiblevault" {
- # vault_path = ".vault-password"
- vault_pass = var.ansible_vault_pass
- root_folder = "."
-}
-
-data "ansiblevault_path" "scaleway_access_key" {
- path = "vault/scaleway.yml"
- key = "scaleway_access_key"
-}
-data "ansiblevault_path" "scaleway_secret_key" {
- path = "vault/scaleway.yml"
- key = "scaleway_secret_key"
-}
-data "ansiblevault_path" "scaleway_organization" {
- path = "vault/scaleway.yml"
- key = "scaleway_organization"
-}
-
-provider "scaleway" {
- region = "fr-par"
- zone = "fr-par-1"
- access_key = data.ansiblevault_path.scaleway_access_key.value
- secret_key = data.ansiblevault_path.scaleway_secret_key.value
- organization_id = data.ansiblevault_path.scaleway_organization.value
-}
-
-# This can also be generated from input objects, but it might be reused between different modules so some control
-# over if/when it is generated is required.
-resource "google_dns_managed_zone" "acme" {
- name = "acme"
- dns_name = "machine.acme.com."
-}
-
-module "acme-apps" {
- source = "../acme-apps/terraform"
- providers = {
- scaleway = scaleway
- }
-
- acme_zone = google_dns_managed_zone.acme.name
-}