Giter Site home page Giter Site logo

jclaveau / ansible-vagrant-modules Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 240 KB

Vagrant commands and config management as modules for Ansible to let you control vagrant VMs from an ansible playbook.

Ruby 17.36% Python 80.06% Shell 2.27% Jinja 0.12% Smarty 0.19%

ansible-vagrant-modules's People

Contributors

caljess599 avatar jclaveau avatar majidaldo avatar robparrott avatar tomaskadlec avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

enmanuelmoreira

ansible-vagrant-modules's Issues

Remove config files if all vms are removed

If 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

Support a network entry

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

Implement the binding to parallel parameter

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:

  • Have a working parallel parameter for vagrant up.
  • Have a working parallel parameter for vagrant destroy.

Todo

  • Check if no other command has a parallel parameter
  • Implement commands for all or several instances #31
  • Extend python-vagrant commands to support it #32
  • Remove this issue from the Important know issues of the readme

Playbook integration tests

delegate_to doesn't work when applied to hosts added with add_host in roles so in integration tests but it works in playbooks.

  • Add integration-playbooks tests

Check if alternative code doesn't exist

Investigate / implement? support of Docker as a provider

Vagrant supports Docker as a provider which seems to be really interesting for performances when no docker in docker is required.

Acceptation:

  • Be able to choose and configure Docker as provider
  • Have a CI environment for Docker
  • Have the required commands to be able ton control Docker easily: Already done, vagrant ssh, halt and destroy would work

Todo:

Polish vagrant.config

  • githook to copy Vagrantfile content into y python wrapper
  • Move VagrantConfig class to module_utils
  • copyright
  • examples add / remove / read

Clean vagrant status output

        "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
                }
            ]
        }

Compare with alternative solutions

Acceptance:

Sources

Do not call status twice when not required

Replace

        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

Add a `provider` option to vagrant.config

Acceptation

  • Be able to choose your provider
  • Be able to configure it
  • Tests
  • Badge by provider

Todo

  • List providers et and available options / urls
    => virtualbox, docker, libvirt
  • Choose which options should be made common / a way to let the liberty to set the others for the user
    => cpus, memory, box / image?, synced folders
    => provider, provider_options
  • Implement and test Virtualbox
  • Implement and test Libvirt
  • Implement and test docker? #45
  • Allow other providers with provider_options_inline
  • Check if vagrant validate is enough to test configuration from yaml or if it just checks the syntax
  • Patch the workflows for CI:
    • Add Ubuntu / Libvirt && rename Integration Tests for MacOS / Virtualbox
    • Run dedicated tests for each platform: failing libvirt on MacOS and failing virtualbox on Ubuntu
  • Update the docs
    • Table for badges
    • Working MacOS/Virtualbox provider
    • Failing MacOS/Libvirt provider
    • Working MacOS/Docker provider
    • Examples for each coverage
  • Clean usunsed vars in CI
  • Fix coverage in CI

Support all commands with empty "name" or "names"

Currently 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:

  • List commands where it could have sens (Vagrant doesn't support "vagrant port" with no name specified for example)
  • Define outputs having the same philosophy as Ansible loop results
  • Factorize calls in the Vagrant adapter
  • Make the name parameter optional when possible
  • Update the tests
  • Update the docs

NOT TO DO: These features depend on the current one

  • Async subcalls to make vagrant use faster
  • Implement names parameter

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.