Giter Site home page Giter Site logo

sunpyopark / ansible-packer-terraform-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alkrauss48/ansible-packer-terraform-demo

0.0 1.0 0.0 469 KB

A simple demo showing how to use Ansible, Packer, and Terraform together

Makefile 20.85% Shell 27.67% HCL 51.48%

ansible-packer-terraform-demo's Introduction

Ansible, Packer, and Terraform Demo

This project combines Ansible, Packer, and Terraform to show how you can automagically script and deploy a server with no manual configuration. In case you're unfamiliar with these 3 tools:

  • Ansible - Automates server configuration
  • Packer - Builds images of a configured server, but doesn't actually deploy it
  • Terraform - Handles deploying an actual server

Overview

This project creates a Digital Ocean droplet that runs a local version of the website https://growlerfriday.com - which is pulled down from its GitHub repo and run using nginx.

If you edit your /etc/hosts file to point growlerfriday.com to the IP address of the created droplet, it will work.

Usage

Prior to running, make sure you have both packer and terraform installed.

git clone https://github.com/alkrauss48/ansible-packer-terraform-demo.git
cd ansible-packer-terraform-demo

# Set the variables in the .env file. At a minimum, this includes:
# * DIGITAL_OCEAN_API_TOKEN
# * SSH_FINGERPRINT

make packer-build
# This will take about 5 minutes. Copy the Snapshot ID you get at the end

make terraform-init
# Only have to do this once

make terraform-plan
<enter Snapshot ID from packer-build command>

# If all looks good, then:

make terraform-apply
<enter Snapshot ID from packer-build command>
# This will take about a minute

# Done!

MIT Licensed. Aaron Krauss.

ansible-packer-terraform-demo's People

Contributors

alkrauss48 avatar

Watchers

 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.