在WINDOWS上通过VAGRANT练习ANSIBLE

有点曲折,但没办法,还要通过VAGRANT里的ANSIBLE建DOCKER呢。。

VagrantFile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
    config.vm.synced_folder ".", "/vagrant", mount_options: ["dmode=700,fmode=600"]
  else
    config.vm.synced_folder ".", "/vagrant"
  end
  config.vm.provider "virtualbox" do |v|
    v.memory = 2048
  end
  config.vm.define :dev do |dev|
    dev.vm.network "private_network", ip: "10.100.199.200"
    dev.vm.provision :shell, path: "bootstrap.sh"
  end
  if Vagrant.has_plugin?("vagrant-cachier")
    config.cache.scope = :box
  end
  if Vagrant.has_plugin?("vagrant-vbguest")
    config.vbguest.auto_update = false
    config.vbguest.no_install = true
    config.vbguest.no_remote = true
  end
end

bootstrap.sh

#!/bin/bash

echo "Installing Ansible..."
apt-get install -y software-properties-common
apt-add-repository ppa:ansible/ansible
apt-get update 
apt-get install -y --force-yes ansible

ansible hosts:

[local]
127.0.0.1 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant

在WINDOWS上通过VAGRANT练习ANSIBLE

上一篇:Win10:Win10系统重装之教小白如何制作一张可以启动Win10系统的U盘(一)


下一篇:Win10:Win10系统重装之教小白如何制作一张可以启动Win10系统的U盘(三)