Giter VIP home page Giter VIP logo

my_packer_best_practice's Introduction

my_packer_best_practice

My best practice of project structure to provison AWS EC2 AMI with Packer.

Preconditions

This repository requires following runtime environment and modules.

Setting up

  • Install ansible
pip install -r requirements.txt -c constraints.txt

Test ansible scripts locally

  • Boot vargrant instance, initialize and take vagrant snapshot for rollback.
make init-vagrant
  • Provison to vagrant instance with null provisioner, and rollback to initial instance state.
    • ROLE : role name linked ansible-playbook file.
make test-local ROLE=hoge

Create AMI

  • Edit your aws credential information on ~/.aws/credentials.
[your-profile]
aws_access_key_id = [your access_key_id]
aws_secret_access_key = [your_secret_access_key]
region = [your region]
  • Edit packer/env-aws-variables.json that includes packer setting for AWS provisioning.
{
    "aws_region": "your-region",
    "aws_vpc_id": "vpc-xxxxxxxxxxxxxx",
    "aws_subnet_id": "subnet-xxxxxxxxxxx",
    "ssh_user": "centos",
    "use_profile": "your-profile",
    "aws_instance_role": "your-packer-role",
    "aws_keypair_name": "your-keypair-name"
}
  • Provision AWS instacne
make create-ami ROLE=hoge AWS_KEY_FILE=${absolute path to aws key file for ssh to instance}

my_packer_best_practice's People

Contributors

soudegesu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

my_packer_best_practice's Issues

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.