Environment Setup¶
This guide will help you set up your local environment to work with the nxthdr infrastructure.
Prerequisites¶
Required Tools¶
- Python 3.11+ with uv package manager
- Ansible 2.9+
- Terraform 1.0+
- SSH access to infrastructure servers
- Vault password (contact admin@nxthdr.dev)
Installation¶
# Install Ansible
sudo apt update
sudo apt install ansible
# Install Terraform
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
Repository Setup¶
1. Clone the Repository¶
2. Configure Vault Password¶
Create a .password
file with the Ansible Vault password:
Security
The .password
file is gitignored and should never be committed. Keep it secure!
3. Verify Vault Access¶
Test that you can decrypt secrets:
This should open the secrets file in your editor. Close without making changes.
4. Configure SSH Access¶
Ensure you have SSH access to the infrastructure servers:
# Test connection to a server
ssh nxthdr@ams01.core.infra.nxthdr.dev
# If using SSH keys, add to your SSH config (~/.ssh/config)
Host *.infra.nxthdr.dev
User nxthdr
IdentityFile ~/.ssh/id_ed25519
5. Initialize Terraform¶
Verify Setup¶
Run a dry-run to verify everything is configured correctly:
# Render templates
make render
# Check what would be synced (dry-run)
ansible-playbook -i inventory/ playbooks/sync-config.yml --check
# Check Terraform plan
terraform -chdir=./terraform plan
If all commands complete without errors, your environment is ready!
Optional: Python Development Environment¶
If you plan to modify the rendering scripts:
This creates a virtual environment with all dependencies for the rendering scripts.
Troubleshooting¶
Vault Decryption Fails¶
Solution: Verify your .password
file contains the correct vault password.
SSH Connection Refused¶
Solution: - Verify you have network access to the servers - Check your SSH key is authorized - Contact admin@nxthdr.dev for access
Terraform Provider Issues¶
Solution: Run terraform init
in the terraform/
directory.
Ansible Module Not Found¶
Solution: Install the required Ansible collection:
Next Steps¶
Now that your environment is set up:
- Follow the Quick Start guide to make your first deployment
- Review Common Tasks for typical operations
- Explore the Reference documentation for deeper understanding