Template Infrastructure as Code - Terraform & Ansible
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This template serves as a starting point for developing Infrastructure as Code projects. It is designed to streamline the process of provisioning and managing resources across public cloud platforms such as AWS, Azure, and Google Cloud. Modify the placeholder values (e.g., github_username, repo_name, twitter_handle, linkedin_username, email_client, email, project_title, project_description, project_license) to customize the template to your specific requirements.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This project requires the following tools:
-
Configuration management and automation tool.
python3 -m pip install --user ansible
-
Infrastructure as Code tool.
# Example for Ubuntu/Debian: 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 terraform --version
-
Cloud CLIs
Command-line interfaces for AWS, Azure, and Google Cloud.
-
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install aws --version
-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash az --version -
# Add the package key and repository sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates gnupg curl curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list # Update and install sudo apt-get update && sudo apt-get install google-cloud-cli gcloud init gcloud --version
-
This section guides users through the process of setting up the IaC environment on their local machine. It typically includes steps for:
- Cloning the repository
- Setting up authentication credentials for cloud providers
- Configuring Terraform backend storage
- Installing any additional dependencies
- Setting up environment variables or configuration files
Once completed, users will have a working environment ready to deploy infrastructure using the templates provided in this project.
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
For more examples, please refer to the Documentation
- Feature 1
- Feature 2
- Feature 3
- Nested Feature
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
template-IaC/
│── ansible/
│ ├── inventories/ # Inventories organized by environment
│ │ ├── dev/
│ │ └── prod/
│ ├── playbooks/ # Playbooks for Ansible execution
│ │ ├── setup.yml
│ │ └── deploy.yml
│ ├── vars/ # Global Ansible variables
│ ├── roles/ # Reusable Ansible roles
│ └── README.md # Documentation for Ansible usage
│
│── terraform/
│ ├── environments/ # Environment-specific configuration (dev, prod)
│ │ ├── dev.tfvars
│ │ └── prod.tfvars
│ ├── modules/ # Reusable Terraform modules
│ ├── backend.tf # Backend configuration for remote state
│ ├── main.tf # General infrastructure definition
│ ├── outputs.tf # Definition of relevant outputs
│ ├── (terraform.tfstate) # State file (should not be versioned)
│ ├── README.md # Documentation for Terraform usage
│ └── variables.tf # Global variables for Terraform
│
│── images/ # Images for documentation
│── scripts/ # Helper scripts (automation, validations)
│── .github/ # GitHub Actions workflows for CI/CD
│ └── workflows/
│── LICENSE # License file for the project
└── README.md # General repository explanationDistributed under the project_license. See LICENSE.txt for more information.
Your Name - @twitter_handle - email@email_client.com
Project Link: https://github.com/github_username/repo_name
