Skip to content

Xavier2p/infra-as-code

Repository files navigation

/forge - Infrastructure as Code

GitHub top language GitHub Workflow Status (with event) Website GitHub

This repository contains the code of /forge, my personal infrastructure.

Hosts

  • scariff: My main server, a Raspberry Pi 4.
  • exegol: My laptop, a MacBook Air M1.
  • eadu: A simple Debian VM, used for testing.
  • mandalore: My development server, a Dell PowerEdge R710 (upcoming...).

Tools

Structure

./forge
├── ansible             # Ansible configuration, pre-deployment
├── hosts               # Hosts configuration
│   ├── common          # Common configuration for all hosts
│   ├── exegol
│   ├── eadu
│   └── scariff
├── stacks              # Stacks of services
│   ├── admin
│   ├── cloud
│   ├── monitoring
│   ├── media
│   └── services
├── hosts.tf            # Hosts configuration
├── main.tf             # Entry point
├── modules             # Terraform modules
├── providers.tf
├── outputs.tf
├── variables.tf
└── forge.tfvars        # Private variables

Deployment

#1 Clone repository

git clone https://github.com/Xavier2p/infra-as-code.git && cd infra-as-code

#2 Pre-deploy configuration (using Ansible)

ansible-playbook -i ansible/hosts.yml -u <USER> -b ansible/playbook.yml

#3 Deploy infrastructure (using Terraform)

terraform init
terraform apply

You can use the -target=module.<module_name> option to deploy only a specific module or a specific host.

License - MIT

MIT License

Copyright (c) 2023 Xavier2p

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.