码迷,mamicode.com
首页 > Windows程序 > 详细

在WINDOWS上通过VAGRANT练习ANSIBLE

时间:2016-09-05 23:29:26      阅读:357      评论:0      收藏:0      [点我收藏+]

标签:

有点曲折,但没办法,还要通过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

标签:

原文地址:http://www.cnblogs.com/aguncn/p/5843889.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!