Deploy a Self-Hosted HCP Vault and Boundary stack using end-to-end automation.
This project provides a comprehensive, hands-on experience in Infrastructure as Code (IaC) and Configuration Management. It simulates a real-world infrastructure environment with a focus on end-to-end automation, enabling DevOps engineers to collaboratively deliver a reliable, production-ready stack. Key deliverables include detailed documentation and diagrams.
As of the latest release, BVSTACK covers steps 0-3 of the DevOpsHobbies Ultimate Roadmap.
- Vagrant
- Virtualbox
- Python => 3.10.12
- Pip
- venv
-
Read the Documentation: Before getting started, ensure you have thoroughly reviewed the project documentation, the automation workflow diagram and installed the prerequisites.
-
Configure Variables: Create your own
tfvarsfile based on the samples provided in the Boundary and Vault directories. Alternatively, you can remove the.sampleextension from the provided sample files to use the default values. -
Run the Start Script: Begin the setup by running the
start.shscript in your desired environment:# Run in development: ./start.sh -e development
you'll be prompted to choose which NIC you want to bridge to by Vagrant.
- Enter Vault Password: You will be prompted to enter the Vault password four times to decrypt Ansible Vault-encrypted files (e.g.,
inventory.ini) unless the related issue is resolved.
Note: The default
ansible-vault-passisBVSTACK. This is provided for simplicity in the sample; ensure you use a strong password for your Ansible Vault-encrypted files.
Note
The stack assumes that your host machine acts as the Ansible/Terraform controller. If you have the resources, it's recommended to spin up a separate VM to serve as the controller by cloning and running the project on that VM. after that you can export STACK_SERVER environment variable and set it to false this enables you to keep your host machine clean and isolated. Otherwise, don't even bother you won't be losing much. learn more about STACK_SERVER
For further assistance on exit/return codes and configurations, refer to the documentation.
- Add a Vagrantfile to provision a VM using the Vagrant provider of your choice, based on the specifications.
- Provision an EC2 instance using the AWS provider based on the specifications and additional required configurations.
- Provision an Azure VM using the Azure provider based on the specifications and additional required configurations.
- Provision a VM on an ESXi server using the vSphere provider based on the specifications.
- Add a remote backend option for Boundary and Vault.
- Implement additional Vault authentication methods.
- Enhance Terraform output values for both Boundary and Vault.
- Implement Policy as Code (PaC) to validate Terraform policies.
- Add a Packer custom image template for VMware vSphere using the specifications.
- Install and configure Terraform on the control node using the
prepare_envrole. - Install and configure Docker on target (managed) nodes using the
prepare_envrole. - Template
tfvarsfiles to handle specific variables for both Boundary and Vault Terraform providers. - Create a well-organized Ansible template for Vault and Boundary configurations.
- Update environment variable declarations in Ansible roles to use the
environmentattribute instead of inline definitions in theshellmodule. - Add proper configurations to serve the stack as a reverse proxy in the
servedirectory (tool optional). - Update
boundary.ymlto use environment variables instead of hardcoding, then manage the export of these variables with Ansible. - Convert Docker Compose files to corresponding Ansible modules using the
community.docker.docker_containercollection as an optional deployment method. - Implement Ansible Molecule scenarios to test different aspects of your roles.
- Choose which provider to provision based on a user-defined or environment variable when handling provisions with Ansible.
- Implement automated testing using GitHub Actions for pull requests.
- Write a custom logger function and implement it throughout all shell scripts for better error handling and logging (in the
logdirectory). - Use
casestatements instead ofiffor argument handling ininit.sh. - Update
start.shto prompt for the Ansible Vault password once and use it for all operations. - Replace sleep commands in
start.shwith the appropriate Ansiblewait_formodules. - Remove the Vault root token in the
cleanupscript.
All contributions are welcome! Please read the Contributing Guidelines for more information.
Copyright © 2024 Shayan Ghani - shayan.ghani.tech@gmail.com