Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rimiti/ansible-debian-vagrant

Example to deploy an Ansible playbook to a Debian Vagrant VM.
https://github.com/rimiti/ansible-debian-vagrant

ansible debian deploy example vagrant

Last synced: 26 days ago
JSON representation

Example to deploy an Ansible playbook to a Debian Vagrant VM.

Awesome Lists containing this project

README

        

# ansible-debian-vagrant

## Description

This project provide a Debian Stretch (9) virtual machine to demonstrate how to execute a Ansible playbook.
This repository can be useful if you want to try your playbook in your local machine.

## Pre-requirements

* [Install Vagrant](http://www.vagrantup.com)
* [Install Ansible](https://www.ansible.com)

## Summary

* [Start VM](#vagrantUp)
* [Stop VM](#vagrantStop)
* [Destroy VM](#vagrantDestroy)
* [Execute Ansible playbook](#executeAnsiblePlaybook)
* [SSH VM](#sshVagrant)

## Commands

### Start VM

Start virtual machine.

__Arguments__

```bash
$ vagrant up
```

---------------------------------------

### Stop VM

Stop virtual machine.

__Arguments__

```bash
$ vagrant halt
```

---------------------------------------

### Destroy VM

Destroy virtual machine.

__Arguments__

```bash
$ vagrant destroy
```

---------------------------------------

### Execute Ansible playbook

Execute Ansible playbook in verbose mode.

__Arguments__

```bash
$ ansible-playbook -i environment/hosts-production --vault-password-file .production playbook.yml --private-key ~/repositories/ansible-debian-vagrant/.vagrant/machines/bart/virtualbox/private_key -vvv
```

---------------------------------------

### Connect to VM from SSH

There are two ways to connect you to your VM.

__Arguments__

```bash
# From Vagrant command
$ vagrant ssh

# From SSH command
$ ssh [email protected] -p 2222 -i ~/repositories/ansible-debian-vagrant/.vagrant/machines/bart/virtualbox/private_key
```