Giter Site home page Giter Site logo

jjg-ansible-windows's Introduction

JJG-Ansible-Windows

Windows shell provisioning script to bootstrap Ansible from within a Vagrant VM running on Windows.

This script is configured to use configure RHEL-based VM (Fedora, CentOS, etc.) so it can run Ansible playbooks from within the VM through Vagrant.

Read more about this script, and other techniques for using Ansible within a Windows environment, on Server Check.in: Running Ansible within Windows.

Usage

In your Vagrantfile, use a conditional provisioning statement if you want to use this script (which runs Ansible from within the VM instead of on your host—this example assumes your playbook and the inventory file are all within a 'provisioning' folder, and this script is within provisioning/JJG-Ansible-Windows):

# Use rbconfig to determine if we're on a windows host or not.
require 'rbconfig'
is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
if is_windows
  # Provisioning configuration for shell script.
  config.vm.provision "shell" do |sh|
    sh.path = "provisioning/JJG-Ansible-Windows/windows.sh"
    sh.args = "provisioning/playbook.yml provisioning/inventory"
  end
else
  # Provisioning configuration for Ansible (for Mac/Linux hosts).
  config.vm.provision "ansible" do |ansible|
    ansible.playbook = "provisioning/playbook.yml"
    ansible.inventory_path = "provisioning/inventory"
    ansible.sudo = true
  end
end

Licensing and More Info

Created by Jeff Geerling in 2014. Licensed under the MIT license; see the LICENSE file for more info.

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.