Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/rimiti/ansible-debian-vagrant
- Owner: rimiti
- Created: 2018-04-24T16:18:07.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-25T09:36:13.000Z (almost 7 years ago)
- Last Synced: 2024-11-07T16:12:16.608Z (3 months ago)
- Topics: ansible, debian, deploy, example, vagrant
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```