From 4329c51de860a481f7d4c20f56d40c756f4a6764 Mon Sep 17 00:00:00 2001 From: fredrikhgrelland <> Date: Fri, 28 Aug 2020 08:54:11 +0000 Subject: [PATCH] Update from https://github.com/fredrikhgrelland/vagrant-hashistack/commit/62a1d8db737b865892a3a905f6d9367603e9d5d3) --- LICENSE | 201 +++++++++++ Makefile | 12 +- README.md | 339 ++++++++++++++++-- README_template.md | 51 +++ Vagrantfile | 14 +- Vagrantfile.default | 12 + dev/ansible/README.md | 2 +- dev/vagrant/conf/README.md | 1 + dev/vagrant/conf/consul/README.md | 2 +- dev/vagrant/conf/nomad/README.md | 2 +- dev/vagrant/conf/pre_bootstrap/README.md | 2 +- dev/vagrant/conf/vault/README.md | 2 +- docker/README.md | 4 +- example/README.md | 4 +- {test_example => template_example}/.env | 0 template_example/Vagrantfile | 2 + .../conf/nomad/countdash.hcl | 0 .../dev/ansible/01_build_docker_image.yml | 5 +- .../dev/ansible/02_run_terraform.yml | 0 .../dev/ansible/playbook.yml | 0 .../dev/vagrant/conf/consul/99-override.hcl | 0 .../dev/vagrant/conf/nomad/99-override.hcl | 0 .../dev/vagrant/conf/post_ansible.sh | 0 .../post_bootstrap/00-poststart-example.yml | 0 .../post_bootstrap/01-poststart-example.yml | 0 .../post_bootstrap/02-poststart-example.yml | 0 .../dev/vagrant/conf/pre_ansible.sh | 0 .../pre_bootstrap/00-prestart-example.yml | 0 .../pre_bootstrap/01-prestart-example.yml | 0 .../pre_bootstrap/02-prestart-example.yml | 0 .../dev/vagrant/conf/vault/99-override.hcl | 0 .../docker/.dockerignore | 0 .../docker/Dockerfile | 0 .../docker/conf/certificates/.gitignore | 0 .../docker/conf/certificates/README.md | 0 .../example/main.tf | 0 .../example/nomad_acl_test.tf | 0 .../example/variables.tf | 0 {test_example => template_example}/main.tf | 0 {test_example => template_example}/outputs.tf | 0 .../variables.tf | 0 test_example/Vagrantfile | 11 - 42 files changed, 598 insertions(+), 68 deletions(-) create mode 100644 LICENSE create mode 100644 README_template.md create mode 100644 Vagrantfile.default rename {test_example => template_example}/.env (100%) create mode 100644 template_example/Vagrantfile rename {test_example => template_example}/conf/nomad/countdash.hcl (100%) rename {test_example => template_example}/dev/ansible/01_build_docker_image.yml (83%) rename {test_example => template_example}/dev/ansible/02_run_terraform.yml (100%) rename {test_example => template_example}/dev/ansible/playbook.yml (100%) rename {test_example => template_example}/dev/vagrant/conf/consul/99-override.hcl (100%) rename {test_example => template_example}/dev/vagrant/conf/nomad/99-override.hcl (100%) rename {test_example => template_example}/dev/vagrant/conf/post_ansible.sh (100%) rename {test_example => template_example}/dev/vagrant/conf/post_bootstrap/00-poststart-example.yml (100%) rename {test_example => template_example}/dev/vagrant/conf/post_bootstrap/01-poststart-example.yml (100%) rename {test_example => template_example}/dev/vagrant/conf/post_bootstrap/02-poststart-example.yml (100%) rename {test_example => template_example}/dev/vagrant/conf/pre_ansible.sh (100%) rename {test_example => template_example}/dev/vagrant/conf/pre_bootstrap/00-prestart-example.yml (100%) rename {test_example => template_example}/dev/vagrant/conf/pre_bootstrap/01-prestart-example.yml (100%) rename {test_example => template_example}/dev/vagrant/conf/pre_bootstrap/02-prestart-example.yml (100%) rename {test_example => template_example}/dev/vagrant/conf/vault/99-override.hcl (100%) rename {test_example => template_example}/docker/.dockerignore (100%) rename {test_example => template_example}/docker/Dockerfile (100%) rename {test_example => template_example}/docker/conf/certificates/.gitignore (100%) rename {test_example => template_example}/docker/conf/certificates/README.md (100%) rename {test_example => template_example}/example/main.tf (100%) rename {test_example => template_example}/example/nomad_acl_test.tf (100%) rename {test_example => template_example}/example/variables.tf (100%) rename {test_example => template_example}/main.tf (100%) rename {test_example => template_example}/outputs.tf (100%) rename {test_example => template_example}/variables.tf (100%) delete mode 100644 test_example/Vagrantfile diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Makefile b/Makefile index 261cecf..ebfe6c8 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,10 @@ export PATH := $(shell pwd)/tmp:$(PATH) .ONESHELL .PHONY: up update-box destroy-box remove-tmp clean example .DEFAULT_GOAL := up +#### Pre requisites #### +install: + mkdir -p tmp;(cd tmp; git clone --depth=1 https://github.com/fredrikhgrelland/vagrant-hashistack.git; cd vagrant-hashistack; make install); rm -rf tmp/vagrant-hashistack + #### Development #### # start commands dev: update-box @@ -24,12 +28,12 @@ endif test: clean up -example: custom_ca +template-example: custom_ca ifdef CI # CI is set in Github Actions - cd test_example; SSL_CERT_FILE=${SSL_CERT_FILE} CURL_CA_BUNDLE=${CURL_CA_BUNDLE} vagrant up --provision + cd template_example; SSL_CERT_FILE=${SSL_CERT_FILE} CURL_CA_BUNDLE=${CURL_CA_BUNDLE} vagrant up --provision else - cp -f docker/conf/certificates/*.crt test_example/docker/conf/certificates - cd test_example; SSL_CERT_FILE=${SSL_CERT_FILE} CURL_CA_BUNDLE=${CURL_CA_BUNDLE} CUSTOM_CA=${CUSTOM_CA} ANSIBLE_ARGS='--extra-vars "local_test=true"' vagrant up --provision + if [ -f "docker/conf/certificates/*.crt" ]; then cp -f docker/conf/certificates/*.crt template_example/docker/conf/certificates; fi + cd template_example; SSL_CERT_FILE=${SSL_CERT_FILE} CURL_CA_BUNDLE=${CURL_CA_BUNDLE} CUSTOM_CA=${CUSTOM_CA} ANSIBLE_ARGS='--extra-vars "local_test=true"' vagrant up --provision endif # clean commands diff --git a/README.md b/README.md index 95c07e4..f98ba4c 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,169 @@ -# Starter template for `fredrikhgrelland/hashistack` + +

+ Vagrant-hashistack +

Vagrant-hashistack Template

+

Starter template for fredrikhgrelland/vagrant-hashistack

+

+ + Build + + + Releases + + + Updated + +
+
+

+ + + +

+

-This repository can be used as a base for developing services on the hashistack. -On github, you may use the ["Use this template"](https://github.com/fredrikhgrelland/vagrant-hashistack-template/generate) button to generate a new repository from this template. +## Content +1. [Description - What & Why](#description---what--why) + 1. [Why Does This Exist?](#why-does-this-exist) + 2. [Services](#services) +2. [Install Prerequisites](#install-prerequisites) + 1. [Packages that needs to be pre-installed](#packages-that-needs-to-be-pre-installed) + 1. [MacOS Specific](#macos-specific) + 2. [Ubuntu Specific](#ubuntu-specific) +3. [Configuration](#configuration) + 1. [Startup Scheme](#startup-scheme) + 1. [Detailed Startup Procedure](#detailed-startup-procedure) + 2. [Pre and Post Hashistack Startup Procedure](#pre-and-post-hashistack-startup-procedure) + 1. [Ansible Playbooks Pre and Post Hashistack Startup](#ansible-playbooks-pre-and-post-hashistack-startup) + 2. [Bash Scripts Pre and Post Ansible Playbook](#bash-scripts-pre-and-post-ansible-playbook) + 3. [Pre-packaged Configuration Switches](#pre-packaged-configuration-switches) + 1. [Enterprise vs Open Source Software (OSS)](#enterprise-vs-open-source-software-oss) + 2. [Nomad](#nomad) + 3. [Consul](#consul) + 4. [Vault](#vault) + 1. [Consul Secrets Engine](#consul-secrets-engine) + 2. [Vagrant Box Resources](#vagrant-box-resources) +4. [Usage](#usage) + 1. [Commands](#commands) + 2. [MinIO](#minio) + 1. [Pushing Resources To MinIO With Ansible (Docker image)](#pushing-resources-to-minio-with-ansible-docker-image) + 2. [Fetching Resources From MinIO With Nomad (Docker image)](#fetching-resources-from-minio-with-nomad-docker-image) + 3. [Iteration of the Development Process](#iteration-of-the-development-process) +5. [Test Configuration and Execution](#test-configuration-and-execution) -If you found this in `fredrikhgrelland/vagrant-hashistack`, you may be interested in this separate repository [vagrant-hashistack-template](https://github.com/fredrikhgrelland/vagrant-hashistack-template/generate) button to start a new repository from this repo -. -Documentation on [parent repository](https://github.com/fredrikhgrelland/vagrant-hashistack#usage). +## Description - What & Why +This template is a starting point, and example, on how to take advantage of the [Hashistack vagrant-box](https://app.vagrantup.com/fredrikhgrelland/boxes/hashistack) to create, develop, and test Terraform-modules within the Hashistack ecosystem. -## Customizing and using the vagrant box +**Hashistack**, in current repository context, is a set of software products by [HashiCorp](https://www.hashicorp.com/). -### Building and testing docker image -See docker [README.md](docker/README.md). -### Starting a box -The vagrant box ships with a default startup scheme. `make` from this directory will start the box, and it will run all books in [dev/ansible](dev/ansible) in lexical order (NB: `playbook.yml` is run first, but is only used to run all other playbooks) after the bootstrap-process for the hashistack is done. In the [example](test_example/dev/ansible/playbook.yml) we use it to start terraform which then starts a nomad-job. +> :bulb: If you found this in `fredrikhgrelland/vagrant-hashistack`, you may be interested in the separate repository [vagrant-hashistack-template](https://github.com/fredrikhgrelland/vagrant-hashistack-template/). -### Pre and post hashistack procedure -You may change the hashistack configuration or add aditional pre and post steps to the startup procedure to match your needs. +> :warning: If you are reading this in your own repository, go to [If This Is in Your Own Repository](#if-this-is-in-your-own-repository) + +### Why Does This Exist? + This template aims to standardize workflow for building and testing terraform-nomad-modules, using the [fredrikhgrelland/hashistack](https://github.com/fredrikhgrelland/vagrant-hashistack) vagrant-box. + + +### Services +The default box will start Nomad, Vault, Consul and MinIO bound to loopback and advertising on the IP `10.0.3.10`, which should be available on your local machine. +Port-forwarding for `nomad` on port `4646` should bind to `127.0.0.1` and should allow you to use the nomad binary to post jobs directly. +Consul and Vault have also been port-forwarded and are available on `127.0.0.1` on ports `8500` and `8200` respectively. +Minio is started on port `9000` and shares the `/vagrant` (your repo) from within the vagrant box. + +|Service|URL|Token(s)| +|:---|:---:|:---:| +|Nomad| [http://10.0.3.10:4646](http://10.0.3.10:4646)|| +|Consul| [http://10.0.3.10:8500](http://10.0.3.10:8500)|master| +|Vault| [http://10.0.3.10:8200](http://10.0.3.10:8200)|master| +|Minio| [http://10.0.3.10:9000](http://10.0.3.10:9000)|minioadmin : minioadmin| + + +## Install Prerequisites + +```text +make install +``` + +The command, will install: +- [VirtualBox](https://www.virtualbox.org/) +- [Packer](https://www.packer.io/) +- [Vagrant](https://www.vagrantup.com/) with additional plugins +- [Additional software dependent on the OS (Linux, MacOS)](../install/Makefile) + +### Packages that needs to be pre-installed + +- [Make](https://man7.org/linux/man-pages/man1/make.1.html) +- [Git CLI](https://git-scm.com/book/en/v2/Getting-Started-The-Command-Line) + +#### MacOS Specific +- Virtualization must be enabled. [This is enabled by default on MacOS.](https://support.apple.com/en-us/HT203296) +- [Homebrew](https://brew.sh/) must be installed. + +#### Ubuntu Specific +- Virtualization must be enabled. [Error if it is not.](https://github.com/fredrikhgrelland/vagrant-hashistack/issues/136) +- Packages [gpg](http://manpages.ubuntu.com/manpages/xenial/man1/gpg.1.html) and [apt](http://manpages.ubuntu.com/manpages/bionic/man8/apt.8.html) must be installed. + +--- + +`NB` _Post installation you might need to reboot your system in order to start the virtual-provider (VirtualBox)_ + +--- + + +## Configuration + +### Startup Scheme +From a thousand foot view the startup scheme will: +1. Start the hashistack and MinIO +2. Run [playbook.yml](dev/ansible/playbook.yml), which in turn runs all ansible-playbooks inside [dev/ansible/](dev/ansible). + +> :bulb: Vagrantfile lines 8-11 run the first playbook on startup, and can be changed. + +> :bulb: Below is a detailed description of the _whole_ startup procedure, both user changeable and not. + +--- + +#### Detailed Startup Procedure +_box_ - Comes bundled with the box, not possible to change + +_system_ - Provided by the system in automated processes, not possible to change + +_user_ - Provided by the user to alter the box or template in some way + +|Seq number| What | Provided by | Description | +|:--:|:------------|:------------:|:-----| +|1 |`/home/vagrant/.env_default`|[ _box_ ]| default variables | +|2 |`/vagrant/.env`|[ _user_ ]| variables override, see [Pre-packaged Configuration Switches](#pre-packaged-configuration-switches) for details | +|3 |`/vagrant/.env_override`|[ _system_ ]| variables are overridden for test purposes | +|4 |`/vagrant/dev/vagrant/conf/pre_ansible.sh`|[ _user_ ]| script running before ansible bootstrap procedure, [details](dev/vagrant/conf/pre_bootstrap/README.md) | +|5 |`/vagrant/dev/vagrant/conf/pre_bootstrap/*.yml`|[ _user_ ]| pre bootstrap tasks, running before hashistack software starts, [details](dev/vagrant/conf/README.md) | +|6 |`/etc/ansible/bootstrap.yml`|[ _box_ ]| verify ansible variables and software configuration, run hashistack software and MinIO, & verify that it started correctly, [link](../ansible/bootstrap.yml) | +|7 |`/vagrant/conf/post_bootstrap/*.yml`|[ _user_ ]| poststart scripts, running after hashistack software has started, [details](dev/vagrant/conf/pre_bootstrap/README.md) | +|8 |`/vagrant/dev/conf/post_ansible.sh`|[ _user_ ]| script running after ansible bootstrap procedure, [details](dev/vagrant/conf/README.md) | +|9 |`/vagrant/ansible/*.yml`|[ _user_ ]| ansible tasks included in playbook, see [Pre-packaged Configuration Switches](#pre-packaged-configuration-switches) for details | + +--- + +### Pre and Post Hashistack Startup Procedure +#### Ansible Playbooks Pre and Post Hashistack Startup +You may change the hashistack configuration or add additional pre and post steps to the ansible startup procedure to match your needs. Detailed documentation in [dev/vagrant/conf/README.md](dev/vagrant/conf/README.md) -### Pre packaged configuration switches +#### Bash Scripts Pre and Post Ansible Playbook +In addition to ansible playbooks, you can also add bash-scripts that will be run before and/or after the ansible provisioning step. This is useful for doing deeper changes to the box pertaining to your needs. Detailed documentation in [dev/vagrant/conf/README.md](dev/vagrant/conf/README.md) + + +### Pre-packaged Configuration Switches -The box comes standard with a set of environment switches to simplify testing of different scenarios and enable staged development efforts. +The box comes [with a set of configuration switches controlled by env variables](https://github.com/fredrikhgrelland/vagrant-hashistack#configuration) to simplify testing of different scenarios and enable staged development efforts. +To change any of these values from their defaults, you may add the environment variable to [.env](dev/.env). -NB: All lowercase variables will automatically get a corresponding TF_VAR_ prepended variant for use directly in terraform. -To change from the default value, you may add the environment variable to [.env](dev/.env) +NB: All lowercase variables will automatically get a corresponding `TF_VAR_` prepended variant for use directly in terraform. [Script](../.github/action/create-env.py) #### Enterprise vs Open Source Software (OSS) -As long as Enterprise is not set to `true` the box will utilise OSS version of the binaries. +To use enterprise versions of the hashistack components set the software's corresponding Enterprise-variable to `true` (see below). #### Nomad @@ -39,7 +174,7 @@ As long as Enterprise is not set to `true` the box will utilise OSS version of t | | nomad_acl | true | | x | nomad_acl | false | -When ACLs in Nomad are enabled the bootstrap token will be available in vault under `secret/nomad/management-token` with the two key-value pairs `accessor-id` and `secret-id`. `secret-id` is the token itself. These can be accessed in several ways: +When ACLs are enabled in Nomad the bootstrap token will be available in vault under `secret/nomad/management-token` with the two key-value pairs `accessor-id` and `secret-id`. `secret-id` is the token itself. These can be accessed in several ways: - From inside the vagrant box with `vault kv get secret/nomad-bootstrap-token` - From local machine with `vagrant ssh -c vault kv get secret/nomad-bootstrap-token"` - By going to vault's UI on `localhost:8200`, and signing in with the root token. @@ -62,7 +197,7 @@ When ACLs in Nomad are enabled the bootstrap token will be available in vault un | | vault_enterprise | true | | x | vault_enterprise | false | -##### Consul secrets engine +##### Consul Secrets Engine If `consul_acl_default_policy` has value `deny`, it will also enable [consul secrets engine](https://www.vaultproject.io/docs/secrets/consul) in vault. Ansible will provision additional custom roles (admin-team, dev-team), [policies](../ansible/templates/consul-policies) and tokens for test purpose with different access level. @@ -76,15 +211,155 @@ vagrant ssh -c 'vault read consul/creds/dev-team' vagrant ssh -c 'vault read consul/creds/admin-team' ``` -*Tokens can be used to access UI (different access level depends on role) - -## Vagrant box life-cycle -1. `/home/vagrant/.env_default` - _preloaded_ - default variables -1. `vagrant/.env` - _user provided_ - variables override -1. `vagrant/.env_override` - _system provided_ - variables are overridden for test purposes -1. `vagrant/dev/vagrant/conf/pre_ansible.sh` - _user provided_ - script running before ansible bootstrap procedure -1. `vagrant/dev/vagrant/conf/pre_bootstrap/*.yml` - _user provided_ - pre bootstrap tasks, running before hashistack software runs and ready -1. `/etc/ansible/bootstrap.yml` - _preloaded_ - verify ansible variables and software configuration, run hashistack software & verify that it started correctly -1. `vagrant/conf/post_bootstrap/*.yml` - _user provided_ - poststart scripts, running after hasistack software runs and ready -1. `vagrant/dev/conf/pre_ansible.sh` - _user provided_ - script running after ansible bootstrap procedure -1. `vagrant/ansible/*.yml` - _user provided_ - ansible tasks included in playbook +> :bulb: Tokens can be used to access UI (different access level depends on policy attached to the token) + +### Vagrant Box Resources +If you get the error message `Dimension memory exhausted on 1 node` or `Dimension CPU exhausted on 1 node`, you might want to increase resources dedicated to your vagrant-box. +To overwrite the default resource-configuration you can add the lines +```hcl +Vagrant.configure("2") do |config| + config.vm.provider "virtualbox" do |vb| + vb.memory = 2048 + vb.cpu = 2 + end +end +``` +to the bottom of your [Vagrantfile](Vagrantfile), and change `vb.memory` and `vb.cpu` to suit your needs. Any configuration in [Vagrantfile](Vagrantfile) will overwrite the defaults if there is any. [More configuration options](https://www.vagrantup.com/docs/providers/virtualbox/configuration.html). + +> :bulb: The defaults can be found in [Vagrantfile.default](Vagrantfile.default). + + +## Usage +### Commands +There are several commands that help to run the vagrant-box: +- `make install` installs all prerequisites. Run once. + +- `make up` provisions a [vagrant-hashistack](https://github.com/fredrikhgrelland/vagrant-hashistack/) box on your machine. After the machine and hashistack are set up it will run the [Startup Scheme](#startup-scheme). + +- `make clean` takes down the provisioned box if there is any. + +- `make update` downloads the newest version of the [vagrant-hashistack box](https://github.com/fredrikhgrelland/vagrant-hashistack/) from [vagrantcloud](https://vagrantcloud.com/fredrikhgrelland/hashistack). + +- `make example` runs the example in [template_example/](template_example) + +> :bulb: For full info, check [`template/Makefile`](./Makefile). +> :warning: Makefile commands are not idempotent in the context of vagrant-box. You could face the error of port collisions. Most of the cases it could happen because of the vagrant box has already been running. Run `vagrant destroy -f` to destroy the box. + +Once vagrant-box is running, you can use other [options like the Nomad- and Terraform-CLIs to iterate over the deployment in the development stage](#iteration-of-the-development-process). + +### MinIO +Minio S3 can be used as a general artifact repository while building and testing within the scope of the vagrantbox to push, pull and store resources for further deployments. + +> :warning: Directory `/vagrant` is mounted to minio. Only first level of sub-directories become bucket names. + +Resource examples: +- docker images +- compiled binaries +- jar files +- etc... + +#### Pushing Resources To MinIO With Ansible (Docker image) +Push(archive) of docker image. +```yaml +# NB! Folder /vagrant is mounted to Minio +# Folder `dev` is going to be a bucket name +- name: Create tmp if it does not exist + file: + path: /vagrant/dev/tmp + state: directory + mode: '0755' + owner: vagrant + group: vagrant + +- name: Archive docker image + docker_image: + name: docker_image + tag: local + archive_path: /vagrant/dev/tmp/docker_image.tar + source: local +``` +[Full example](template_example/dev/ansible/01_build_docker_image.yml) + +#### Fetching Resources From MinIO With Nomad (Docker image) +> :bulb: [The artifact stanza](https://www.nomadproject.io/docs/job-specification/artifact) instructs Nomad to fetch and unpack a remote resource, such as a file, tarball, or binary. + +Example: +```hcl +task "web" { + driver = "docker" + artifact { + source = "s3::http://127.0.0.1:9000/dev/tmp/docker_image.tar" + options { + aws_access_key_id = "minioadmin" + aws_access_key_secret = "minioadmin" + } + } + config { + load = "docker_image.tar" + image = "docker_image:local" + } +} +``` +[Full example](./template_example/conf/nomad/countdash.hcl) + +### Iteration of the Development Process + +Once you start the box with one of the commands `make dev`, `make up` or `make example`, +you need a simple way how to continuously deploy development changes. + +There are several options: + +1. **From the local machine**. You can install Hashicorp binaries on the local machine, such as terraform and nomad. +Then you can deploy changes to the vagrant-box using these binaries. + +Example terraform: +```text +terraform init +terraform apply +``` + +Example nomad: +```text +nomad job run countdash.hcl +``` + +> :warning: _Your local binaries and the binaries in the box might not be the same versions, and may behave differently. [Box versions.](../ansible/group_vars/all/variables.yml) + +2. **Using vagrant**. Box instance has all binaries are installed and available in the PATH. +You can use `vagrant ssh` to place yourself inside of the vagrantbox and run commands. + +```text +# remote command execution +vagrant ssh default -c 'cd /vagrant; terraform init; terraform apply' + +# ssh inside the box, local command execution +vagrant ssh default +cd /vagrant +terraform init +terraform apply +``` + +> :bulb: `default` is the name of running VM. You could also use VM `id`. +To get vm `id` check `vagrant global-status`. + +## Test Configuration and Execution +The tests are run using [Github Actions](https://github.com/features/actions) feature which makes it possible to automate, customize, and execute the software development workflows right in the repository. We utilize the **matrix testing strategy** to cover all the possible and logical combinations of the different properties and values that the components support. The .env_override file is used by the tests to override the values that are available in the .env_default file, as well as the user configurable .env file. + + +As of today, the following tests are executed: + +| Test name | Consul Acl | Consul Acl Policy | Nomad Acl | Hashicorp binary +|:------------------------------------------------------------------------------------------:|:------------|:-------------------:|:-------------:|:---------------:| +| test (consul_acl_enabled, consul_acl_deny, nomad_acl_enabled, hashicorp_oss) | true | deny | true | Open source | +| test (consul_acl_enabled, consul_acl_deny, nomad_acl_enabled, hashicorp_enterprise) | true | deny | true | enterprise | +| test (consul_acl_enabled, consul_acl_deny, nomad_acl_disabled, hashicorp_oss) | true | deny | false | Open source | +| test (consul_acl_enabled, consul_acl_deny, nomad_acl_disabled, hashicorp_enterprise) | true | deny | false | enterprise | +| test (consul_acl_disabled, consul_acl_deny, nomad_acl_enabled, hashicorp_oss) | false | deny | true | Open source | +| test (consul_acl_disabled, consul_acl_deny, nomad_acl_enabled, hashicorp_enterprise) | false | deny | true | enterprise | +| test (consul_acl_disabled, consul_acl_deny, nomad_acl_disabled, hashicorp_oss) | false | deny | false | Open source | +| test (consul_acl_disabled, consul_acl_deny, nomad_acl_disabled, hashicorp_enterprise) | false | deny | false | enterprise | + +The latest test results can be looked up under the **Actions** tab. + +## If This Is in Your Own Repository +If you are reading this from your own repository you should _delete_ this `README.md`, fill out `README_template.md`, and rename `README_template.md` to `README.md`. \ No newline at end of file diff --git a/README_template.md b/README_template.md new file mode 100644 index 0000000..fb0e273 --- /dev/null +++ b/README_template.md @@ -0,0 +1,51 @@ + +

+ +> :warning: The text under headlines are examples, and should be removed. +> +> :warning: Remove this line and the one above! + +# Terraform-module name + +## Compatibility +List of compatible versions. E.g. +1. Terraform 0.12.2 or newer +2. Nomad 0.12 or newer + +## Usage + +### Requirements +#### Required software +1. Software 1 +2. Software 2 + +#### Other +Any other requirements. E.g. "This needs to be run on a Debian system" + +### Providers +A description of the providers that the module uses. E.g. "This module uses the [Nomad](https://registry.terraform.io/providers/hashicorp/nomad/latest/docs) and [Vault](https://registry.terraform.io/providers/hashicorp/vault/latest/docs) providers" + +## Inputs +|Name |Description |Type |Default |Required | +|:--|:--|:--|:-:|:-:| +| | |bool |true |yes | + +## Outputs +|Name |Description |Type |Default |Required | +|:--|:--|:--|:-:|:-:| +| | |bool |true |yes | + +### Example +Example-code that shows how to use the module, and, if applicable, its different use cases. +```hcl-terraform +module "example"{ + source = "./" +} +``` + +### Verifying setup +Description of expected end result and how to check it. E.g. "After a successful run Presto should be available at localhost:8080". + +## Authors + +## License \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile index 3ad3025..308f255 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,12 +1,2 @@ -Vagrant.configure("2") do |config| - config.vm.box = "fredrikhgrelland/hashistack" - config.vm.box_version = ">= 0.3, < 0.4" - config.vm.provider "virtualbox" do |vb| - vb.linked_clone = true - vb.memory = 2048 - end - config.vm.provision "ansible_local" do |ansible| - ansible.provisioning_path = "/vagrant/dev/ansible" - ansible.playbook = "playbook.yml" # Note this playbook is, in this context, /ansible/playbook.yml - end -end +default_vagrantfile = "Vagrantfile.default" +load default_vagrantfile if File.exists?(default_vagrantfile) \ No newline at end of file diff --git a/Vagrantfile.default b/Vagrantfile.default new file mode 100644 index 0000000..bbcaf77 --- /dev/null +++ b/Vagrantfile.default @@ -0,0 +1,12 @@ +Vagrant.configure("2") do |config| + config.vm.box = "fredrikhgrelland/hashistack" + config.vm.box_version = ">= 0.3, < 0.4" + config.vm.provider "virtualbox" do |vb| + vb.linked_clone = true + vb.memory = 2048 + end + config.vm.provision "ansible_local" do |ansible| + ansible.provisioning_path = "/vagrant/dev/ansible" + ansible.playbook = "playbook.yml" # Note this playbook is, in this context, /ansible/playbook.yml + end +end \ No newline at end of file diff --git a/dev/ansible/README.md b/dev/ansible/README.md index 256dfda..66e30be 100644 --- a/dev/ansible/README.md +++ b/dev/ansible/README.md @@ -3,4 +3,4 @@ This is a good starting point where you may run a series of sequential steps. In the example, we use ansible to initialize and start a terraform job which in turn starts nomad jobs in parallel. -Se [example](../../test_example/dev/ansible) \ No newline at end of file +See [example](../../template_example/dev/ansible) \ No newline at end of file diff --git a/dev/vagrant/conf/README.md b/dev/vagrant/conf/README.md index 7657570..dc83a86 100644 --- a/dev/vagrant/conf/README.md +++ b/dev/vagrant/conf/README.md @@ -11,6 +11,7 @@ You may add a `pre_ansible.sh` script file to this directory to run any alterati This might come handy if you need to change or replace that bootstrap process. For example you replacing the entire `/etc/ansible` directory. For most cases, you are probably looking to add configuration in [pre/poststart bootstrap](pre_bootstrap/README.md) + #### Post If you need to run additional commands after ansible bootstrap has happened, you may add a `post_ansible.sh`. This might come in handy if you would like to pat your self on tha back or test a recent configuration change before anything you might add to your own Vagrantfile. diff --git a/dev/vagrant/conf/consul/README.md b/dev/vagrant/conf/consul/README.md index a9b927b..6f53275 100644 --- a/dev/vagrant/conf/consul/README.md +++ b/dev/vagrant/conf/consul/README.md @@ -5,4 +5,4 @@ Any valid configuration added to this directory will append the configuration, i Adding a file `99-override.hcl` you will ensure it will be appended last, and 00-override.hcl will be read first. Any valid configuration from [https://www.consul.io/docs/agent/options.html#configuration_files](https://www.consul.io/docs/agent/options.html#configuration_files) will work. -See [example](../../../../test_example/dev/vagrant/conf/consul/99-override.hcl) +See [example](../../../../template_example/dev/vagrant/conf/consul/99-override.hcl) diff --git a/dev/vagrant/conf/nomad/README.md b/dev/vagrant/conf/nomad/README.md index c08e492..97e8b6f 100644 --- a/dev/vagrant/conf/nomad/README.md +++ b/dev/vagrant/conf/nomad/README.md @@ -16,4 +16,4 @@ client { } ``` -See [example](../../../../test_example/dev/vagrant/conf/nomad/99-override.hcl) \ No newline at end of file +See [example](../../../../template_example/dev/vagrant/conf/nomad/99-override.hcl) \ No newline at end of file diff --git a/dev/vagrant/conf/pre_bootstrap/README.md b/dev/vagrant/conf/pre_bootstrap/README.md index 4350d9a..2fa6252 100644 --- a/dev/vagrant/conf/pre_bootstrap/README.md +++ b/dev/vagrant/conf/pre_bootstrap/README.md @@ -12,4 +12,4 @@ The files e.g. 0-example.yml must only include pure ansible task syntax: msg: This would be a prestart task ``` -See [example](../../../../test_example/dev/vagrant/conf/pre_bootstrap/00-prestart-example.yml) \ No newline at end of file +See [example](../../../../template_example/dev/vagrant/conf/pre_bootstrap/00-prestart-example.yml) \ No newline at end of file diff --git a/dev/vagrant/conf/vault/README.md b/dev/vagrant/conf/vault/README.md index 1819c1b..fb58a81 100644 --- a/dev/vagrant/conf/vault/README.md +++ b/dev/vagrant/conf/vault/README.md @@ -6,4 +6,4 @@ Any valid configuration added to this directory will append the configuration, i Adding a file `99-override.hcl` you will ensure it will be appended last, and 00-override.hcl will be read first. Any valid configuration from [https://www.vaultproject.io/docs/configuration](https://www.vaultproject.io/docs/configuration) will work. -See [example](../../../../test_example/dev/vagrant/conf/vault/99-override.hcl) \ No newline at end of file +See [example](../../../../template_example/dev/vagrant/conf/vault/99-override.hcl) \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index 2228af7..d1ca9db 100644 --- a/docker/README.md +++ b/docker/README.md @@ -9,8 +9,8 @@ If you have docker installed on your machine, you may `cd docker; docker build - This image can be built and operated behind a corporate proxy where the base os needs to trust a custom CA. While building locally using the Makefile, you may set the environment variable CUSTOM_CA to a custom .crt file in order to import it into the docker image. See [conf/certificates](conf/certificates) -See [../test_example/docker/Dockerfile](../test_example/docker/Dockerfile) for examples on how to import and trust CA for centos/debian/alpine based docker images. +See [../template_example/docker/Dockerfile](../template_example/docker/Dockerfile) for examples on how to import and trust CA for centos/debian/alpine based docker images. ## Building and testing the docker-image within the vagrant-hashistack box -We advise you to build and test your docker image within the hashistack eco-system. Running `make test` will launch the [default playbook](../dev/ansible/playbook.yml) inside the box, and [test_example/](../test_example/) shows a simple build process for building and running the docker image using this. Refer to books in [test_example/dev/ansible](../test_example/dev/ansible) to see details. +We advise you to build and test your docker image within the hashistack eco-system. Running `make test` will launch the [default playbook](../dev/ansible/playbook.yml) inside the box, and [template_example/](../template_example/) shows a simple build process for building and running the docker image using this. Refer to books in [template_example/dev/ansible](../template_example/dev/ansible) to see details. diff --git a/example/README.md b/example/README.md index 37fe4f2..3634ac2 100644 --- a/example/README.md +++ b/example/README.md @@ -1,3 +1,5 @@ # This is a terraform module example +The current directory contains terraform related files that use the module in `../`. See [template_example](../template_example/example/). -TODO: explain \ No newline at end of file +## References +- [Creating Modules - official terraform documentation](https://www.terraform.io/docs/modules/index.html) diff --git a/test_example/.env b/template_example/.env similarity index 100% rename from test_example/.env rename to template_example/.env diff --git a/template_example/Vagrantfile b/template_example/Vagrantfile new file mode 100644 index 0000000..80d35e8 --- /dev/null +++ b/template_example/Vagrantfile @@ -0,0 +1,2 @@ +default_vagrantfile = "../Vagrantfile.default" +load default_vagrantfile if File.exists?(default_vagrantfile) \ No newline at end of file diff --git a/test_example/conf/nomad/countdash.hcl b/template_example/conf/nomad/countdash.hcl similarity index 100% rename from test_example/conf/nomad/countdash.hcl rename to template_example/conf/nomad/countdash.hcl diff --git a/test_example/dev/ansible/01_build_docker_image.yml b/template_example/dev/ansible/01_build_docker_image.yml similarity index 83% rename from test_example/dev/ansible/01_build_docker_image.yml rename to template_example/dev/ansible/01_build_docker_image.yml index db4e7cd..372ec0d 100644 --- a/test_example/dev/ansible/01_build_docker_image.yml +++ b/template_example/dev/ansible/01_build_docker_image.yml @@ -16,6 +16,8 @@ TEST_DOWNLOAD_BUILD_ARGUMENT: https://nrk.no source: build +# NB! Folder /vagrant is mounted to Minio +# Folder `dev` is going to be a bucket name - name: Create tmp if it does not exist file: path: /vagrant/dev/tmp @@ -28,5 +30,6 @@ docker_image: name: docker_image tag: local + http_timeout: 120 archive_path: /vagrant/dev/tmp/docker_image.tar - source: local \ No newline at end of file + source: local diff --git a/test_example/dev/ansible/02_run_terraform.yml b/template_example/dev/ansible/02_run_terraform.yml similarity index 100% rename from test_example/dev/ansible/02_run_terraform.yml rename to template_example/dev/ansible/02_run_terraform.yml diff --git a/test_example/dev/ansible/playbook.yml b/template_example/dev/ansible/playbook.yml similarity index 100% rename from test_example/dev/ansible/playbook.yml rename to template_example/dev/ansible/playbook.yml diff --git a/test_example/dev/vagrant/conf/consul/99-override.hcl b/template_example/dev/vagrant/conf/consul/99-override.hcl similarity index 100% rename from test_example/dev/vagrant/conf/consul/99-override.hcl rename to template_example/dev/vagrant/conf/consul/99-override.hcl diff --git a/test_example/dev/vagrant/conf/nomad/99-override.hcl b/template_example/dev/vagrant/conf/nomad/99-override.hcl similarity index 100% rename from test_example/dev/vagrant/conf/nomad/99-override.hcl rename to template_example/dev/vagrant/conf/nomad/99-override.hcl diff --git a/test_example/dev/vagrant/conf/post_ansible.sh b/template_example/dev/vagrant/conf/post_ansible.sh similarity index 100% rename from test_example/dev/vagrant/conf/post_ansible.sh rename to template_example/dev/vagrant/conf/post_ansible.sh diff --git a/test_example/dev/vagrant/conf/post_bootstrap/00-poststart-example.yml b/template_example/dev/vagrant/conf/post_bootstrap/00-poststart-example.yml similarity index 100% rename from test_example/dev/vagrant/conf/post_bootstrap/00-poststart-example.yml rename to template_example/dev/vagrant/conf/post_bootstrap/00-poststart-example.yml diff --git a/test_example/dev/vagrant/conf/post_bootstrap/01-poststart-example.yml b/template_example/dev/vagrant/conf/post_bootstrap/01-poststart-example.yml similarity index 100% rename from test_example/dev/vagrant/conf/post_bootstrap/01-poststart-example.yml rename to template_example/dev/vagrant/conf/post_bootstrap/01-poststart-example.yml diff --git a/test_example/dev/vagrant/conf/post_bootstrap/02-poststart-example.yml b/template_example/dev/vagrant/conf/post_bootstrap/02-poststart-example.yml similarity index 100% rename from test_example/dev/vagrant/conf/post_bootstrap/02-poststart-example.yml rename to template_example/dev/vagrant/conf/post_bootstrap/02-poststart-example.yml diff --git a/test_example/dev/vagrant/conf/pre_ansible.sh b/template_example/dev/vagrant/conf/pre_ansible.sh similarity index 100% rename from test_example/dev/vagrant/conf/pre_ansible.sh rename to template_example/dev/vagrant/conf/pre_ansible.sh diff --git a/test_example/dev/vagrant/conf/pre_bootstrap/00-prestart-example.yml b/template_example/dev/vagrant/conf/pre_bootstrap/00-prestart-example.yml similarity index 100% rename from test_example/dev/vagrant/conf/pre_bootstrap/00-prestart-example.yml rename to template_example/dev/vagrant/conf/pre_bootstrap/00-prestart-example.yml diff --git a/test_example/dev/vagrant/conf/pre_bootstrap/01-prestart-example.yml b/template_example/dev/vagrant/conf/pre_bootstrap/01-prestart-example.yml similarity index 100% rename from test_example/dev/vagrant/conf/pre_bootstrap/01-prestart-example.yml rename to template_example/dev/vagrant/conf/pre_bootstrap/01-prestart-example.yml diff --git a/test_example/dev/vagrant/conf/pre_bootstrap/02-prestart-example.yml b/template_example/dev/vagrant/conf/pre_bootstrap/02-prestart-example.yml similarity index 100% rename from test_example/dev/vagrant/conf/pre_bootstrap/02-prestart-example.yml rename to template_example/dev/vagrant/conf/pre_bootstrap/02-prestart-example.yml diff --git a/test_example/dev/vagrant/conf/vault/99-override.hcl b/template_example/dev/vagrant/conf/vault/99-override.hcl similarity index 100% rename from test_example/dev/vagrant/conf/vault/99-override.hcl rename to template_example/dev/vagrant/conf/vault/99-override.hcl diff --git a/test_example/docker/.dockerignore b/template_example/docker/.dockerignore similarity index 100% rename from test_example/docker/.dockerignore rename to template_example/docker/.dockerignore diff --git a/test_example/docker/Dockerfile b/template_example/docker/Dockerfile similarity index 100% rename from test_example/docker/Dockerfile rename to template_example/docker/Dockerfile diff --git a/test_example/docker/conf/certificates/.gitignore b/template_example/docker/conf/certificates/.gitignore similarity index 100% rename from test_example/docker/conf/certificates/.gitignore rename to template_example/docker/conf/certificates/.gitignore diff --git a/test_example/docker/conf/certificates/README.md b/template_example/docker/conf/certificates/README.md similarity index 100% rename from test_example/docker/conf/certificates/README.md rename to template_example/docker/conf/certificates/README.md diff --git a/test_example/example/main.tf b/template_example/example/main.tf similarity index 100% rename from test_example/example/main.tf rename to template_example/example/main.tf diff --git a/test_example/example/nomad_acl_test.tf b/template_example/example/nomad_acl_test.tf similarity index 100% rename from test_example/example/nomad_acl_test.tf rename to template_example/example/nomad_acl_test.tf diff --git a/test_example/example/variables.tf b/template_example/example/variables.tf similarity index 100% rename from test_example/example/variables.tf rename to template_example/example/variables.tf diff --git a/test_example/main.tf b/template_example/main.tf similarity index 100% rename from test_example/main.tf rename to template_example/main.tf diff --git a/test_example/outputs.tf b/template_example/outputs.tf similarity index 100% rename from test_example/outputs.tf rename to template_example/outputs.tf diff --git a/test_example/variables.tf b/template_example/variables.tf similarity index 100% rename from test_example/variables.tf rename to template_example/variables.tf diff --git a/test_example/Vagrantfile b/test_example/Vagrantfile deleted file mode 100644 index e9d6a3d..0000000 --- a/test_example/Vagrantfile +++ /dev/null @@ -1,11 +0,0 @@ -Vagrant.configure("2") do |config| - config.vm.box = "fredrikhgrelland/hashistack" - config.vm.provider "virtualbox" do |vb| - vb.linked_clone = true - vb.memory = 2048 - end - config.vm.provision "ansible_local" do |ansible| - ansible.provisioning_path = "/vagrant/dev/ansible" - ansible.playbook = "playbook.yml" # Note this playbook is, in this context, /ansible/playbook.yml - end -end