Coder Social home page Coder Social logo

ansible-exercise's Introduction

Ansible and Terraform Exercise

This repository contains an exercise which leverages Ansible and Terraform to provision infrastructure on AWS and deploy a simple webpage on EC2 instances.

Table of Contents

  1. Getting Started
  2. Instructions
  3. Project Structure
  4. Files and Configuration Details
  5. Credits
  6. Acknowledgements
  7. See Also

Getting Started

  • Clone this repository to your local machine.

    git clone https://github.com/MathoAvito/Ansible-Exercise.git
  • Ensure you have Ansible, Terraform, and AWS CLI installed.

    sudo apt-get update && sudo apt-get install ansible terraform awscli -y

If not installed, you need to install them according to your OS specifications. Make sure you also have AWS CLI configured with your credentials.

Instructions

Check out the instructions for this exercise.

Project Structure

The project has the following structure:

/
├── Ansible/
│   ├── ansible.cfg
│   ├── playbook.yml
│   └── Webfile/
│       └── index.html
└── Terraform/
    ├── main.tf
    ├── variables.tf
    ├── modules/
    │   ├── compute/
    │   │   ├── main.tf
    │   │   ├── variables.tf
    │   │   └── outputs.tf
    │   └── network/
    │       ├── main.tf
    │       ├── variables.tf
    │       └── outputs.tf
    └── entrypoint.sh

Files and Configuration Details

The files within this project are set up as follows:

Terraform

The Terraform files within the Terraform/ directory and its subdirectories are used to provision and configure AWS resources:

  • main.tf: This is the main Terraform configuration file which references the network and compute modules.
  • variables.tf: This file holds the declarations for variables used within the Terraform configuration files.
  • modules/network: This module is used to provision network-related resources, such as a VPC, subnets, an internet gateway, and a security group.
  • modules/compute: This module is used to provision compute-related resources, namely AWS EC2 instances.
  • entrypoint.sh: This script installs the necessary dependencies for Ansible and sets up the Ansible control node.

Ansible

The Ansible files within the Ansible/ directory are used to configure the EC2 instances:

  • ansible.cfg: This is the main Ansible configuration file which sets Ansible defaults and other configurations.
  • playbook.yml: This Ansible playbook is used to deploy a simple webpage to the EC2 instances.

See Also

Credits

This project is maintained by MathoAvito.

License

This project is licensed under the MIT License. See the LICENSE file for details.

ansible-exercise's People

Contributors

mathoavito avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.