Skip to content

Server Provisioning with Ansible, Vagrant and Packer.

License

Notifications You must be signed in to change notification settings

Tocyuki/ansible-playbook-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Ansible Playbook Template

Server Provisioning with Ansible, Vagrant and Packer.

Feature

  • Local environment is Vagrant.
  • Execute Ansible and Packer with docker-compose.
  • Test with Testinfra.
  • Create AMI on AWS with Packer.
  • Execute server provisioning with Ansible.

Requirements

  • docker
  • docker-compose
  • vagrant
  • virtualbox

Advance preparation

If you want to test Vagrant machine from your own terminal, execute the following command.

$ pip install testinfra paramiko
$ vagrant ssh-config > .vagrant/ssh-config
$ py.test -v --hosts=web --ssh-config=.vagrant/ssh-config tests

Usage

Local execute with Vagrant

up

$ vagrant up web

provision

$ vagrant provision web

ssh

$ vagrant ssh web

Create AMI on AWS with Packer

lint

$ docker-compose run --rm packer validate packer/web.json

inspect

$ docker-compose run --rm packer inspect packer/web.json

build

$ docker-compose run --rm packer build packer/web.json

Run Ansible Playbook

lint

$ docker-compose run --rm ansible-playbook -i inventory web.yml --syntax-check

run

$ docker-compose run --rm ansible-playbook -i inventory web.yml

About

Server Provisioning with Ansible, Vagrant and Packer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published