jclaveau / ansible-vagrant-modules Goto Github PK
View Code? Open in Web Editor NEWVagrant commands and config management as modules for Ansible to let you control vagrant VMs from an ansible playbook.
Vagrant commands and config management as modules for Ansible to let you control vagrant VMs from an ansible playbook.
https://blog.scottlowe.org/2015/02/10/using-docker-with-vagrant/
https://www.vagrantup.com/docs/provisioning/docker
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'non_existing_vm'
python-vagrant
misses a lot of features / parameters and is not maintained. A wrapper to it seems to be the best way to gather those new features
TODO:
VagrantUpdated
classIf all vms are removed from the config remove vagrant-hosts.yml
If the Vagrantfile is the same as the one in the module, remove it.
Concerning the groups redefining its api first is required #36
vagrant:
cmd: up
vm_name: frank_%d
count: 8
vagrant:
cmd: halt
vm_name: frank_\d+
vm_name: frank_(0|3|8)
network:
- - public_network
- ip: x.x.x.x
type: dhcp
bridge: ...
- - private_network
- ip: x.x.x.x
netmask: x.x.x.x
:libvirt__network_name: my_network
asnyc
casesSee: #17
Same as jclaveau/ansible-vagrant-modules-legacy@08fa2bc for destroy
vagrant up
and vagrant destroy
provide a parallel
parameter which is passed to the chosen provider.
As a workaround I chose to delegate this responsibility to Ansible for now but it would be a very nice feature.
Acceptance:
parallel
parameter for vagrant up
.parallel
parameter for vagrant destroy
.Todo
This dependency seems to be fat over-engineered code painful to maintain. This module meant to be a binding to Vagrant with as limited changes as the shell usage
Vagrantfile parser in python
https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html
delegate_to doesn't work when applied to hosts added with add_host in roles so in integration tests but it works in playbooks.
Legacy from jclaveau/ansible-vagrant-modules-legacy#7
Use codecov from github action
The common use of vagrant is by creating a vagrantfile manually https://docs.ansible.com/ansible/2.5/scenario_guides/guide_vagrant.html
Best practices for modules https://docs.ansible.com/ansible/latest/dev_guide/developing_modules.html
Found here: https://galaxy.ansible.com/search?deprecated=false&keywords=vagrant&order_by=-relevance&page_size=100&page=1
Simply adding a groups
in ansible
entry?
Common usage of ansible roles
, ansible groups
with vagrant
and kube
: https://devopssec.fr/article/creer-cluster-kubernetes-multi-noeud-vagrant-ansible
Vagrant supports Docker as a provider which seems to be really interesting for performances when no docker in docker
is required.
Acceptation:
Docker
as providerTodo:
box
required for docker, what about git_repo
, image
, build_dir
?Can this bug be the source of issues? ansible/ansible#16403
Docs:
Use Vagrant's names : running, poweroff... ?
"status": {
"frank": [
[
[
"frank",
"running",
"virtualbox"
]
],
[
[
"frank_inst2",
"running",
"virtualbox"
]
]
]
}
Should be:
"status": {
"frank": [
{
"name": "frank",
"state": "running",
"provider": "virtualbox",
"changed": true
},
{
"name": "frank_inst2",
"state": "running",
"provider": "virtualbox",
"changed": true
}
]
}
galaxy.yml
add examples to modules
Tell this version is updated to previous contributors 70ca815
Requirements https://zaiste.net/posts/automatically-install-ansible-galaxy-roles-requirements-yml/
Respect guidelines https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_checklist.html#developing-modules-checklist
Contributing to Ansible https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#contributing-back-to-ansible
run_once
has no sense hereReplace
if status_before['state'] != 'saved':
self.vg.suspend(
vm_name=name
)
status_after = self.raw_statuses(name, must_be_present=True)[name]
if status_before['state'] != status_after['state']:
changed = True
by
if status_before['state'] != 'saved':
self.vg.suspend(
vm_name=name
)
status_after = self.raw_statuses(name, must_be_present=True)[name]
if status_before['state'] != status_after['state']:
changed = True
else:
status_after = status_before
Acceptation
Todo
providers
with provider_options_inline
vagrant validate
is enough to test configuration from yaml or if it just checks the syntaxCurrently I chose to made the "name" parameter required. Matching vagrant commands behavior would required to support it which requires a clean code for manipulating many machines:
TODO:
NOT TO DO: These features depend on the current one
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.