Git Product home page Git Product logo

vagrant-ansible-control-node's Introduction

vagrant-ansible-control-node

Quickly spin a local Ansible control node with Vagrant + VirtualBox.

For more context, read the accompanying blog post.

instant_noodles

Usage

$ git clone https://github.com/Eigenbahn/vagrant-ansible-control-node
$ cd vagrant-ansible-control-node
$ vagrant up
# [...]
$ vagrant ssh

Configuration

Some stuff can be tweaked in the Vagrantfile:

  • config.vm.network: the private IP address to access your host via SSH. If you only use vagrant ssh to connect, you don't care about this.
  • config.vm.synced_folder: A host folder to mount onto the guest filesystem. Multiple entries are allowed.
  • vb.name: the alias given to the VirtualBox VM / Vagrant machine
  • vb.memory: the amount of RAM (in MB) allocated to the VM

Additionally, you can adjust a few variables in the ansible provisioning script:

  • my_reinstall_ansible_from_ppa: When yes, reinstall Ansible from the bleeding edge official Ansible PPA. Defaults to no.
  • my_disable_ansible_host_key_change_check: When yes, Ansible won't complain when the identity of a remote host changes. Defaults to yes.
  • my_ansible_additonal_role_path: When set, additional folders when roles are stored. Separator is :.
  • my_ansible_nb_parallel_targets: When set, number of hosts that can be provisioned in parallel.

Implementation details

Basics

We let Vagrant install Ansible itself by relying on the Ansible Local Provisioner.

2 instances of the provisioning scripts get launched sequentially:

  • normalize: make the machine more compliant with Vagrant recommandations
  • ansible: tweak Ansible, eventually reinstall a more recent version

Choice of base box

I choose to use a Debian base box as I'm more familiar with this familly of distribution.

I selected the official Debian 10 box.

I also projected using generic/debian10 from the Roboxes project but it came bundled with an old version of VirtualBox guest additions.

Likewise, official Ubuntu boxes are also great but have an issue with slow startup time.

Better defaults

A lot of boxes only come with SSH authentication by key.

As per official recommandations, we also set the vagrant and root users password to vagrant and authorize SSH by password.

We also authorize SSH as root.

Similar projects

Going further

If you're an Emacs user, you might want to check out package magrant for a tighter integration with Vagrant cli commands.

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.