1 Star 0 Fork 7

chenzhiyucmd/ansible

forked from walker.zhang/ansible 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Vagrantfile 3.34 KB
一键复制 编辑 原始数据 按行查看 历史
Zhang.Ming(张明) 提交于 2020-05-19 18:24 . Aggregate all roles.
# -*- mode: ruby -*-
# vi: set ft=ruby :
#Global default variables
$defaultBoxName = "bento/ubuntu-18.04-20200512"
$defaultNetworkIdentifier = "private_network"
$defaultStartIp = "192.168.56.208"
$defaultNetMask = "255.255.255.0"
$defaultVmMemory = "1024"
$defaultVmCpu = "1"
$defaultProxyEnabled = false
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# Begin of plugin related configurations
# vagrant-env
if Vagrant.has_plugin?("vagrant-env")
config.env.enable
end
# vagrant-vbguest
if Vagrant.has_plugin?("vagrant-vbguest")
config.vbguest.auto_update=false
config.vbguest.no_install=false
config.vbguest.no_remote=true
end
# vagrant-proxyconf
if Vagrant.has_plugin?("vagrant-proxyconf")
if (ENV['VENV_HTTP_PROXY'])
config.proxy.http = ENV['VENV_HTTP_PROXY']
end
if (ENV['VENV_HTTPS_PROXY'])
config.proxy.https = ENV['VENV_HTTPS_PROXY']
end
if (ENV['VENV_NO_PROXY'])
config.proxy.no_proxy = ENV['VENV_NO_PROXY']
end
end
# End of plugin related configurations
# Begin of setting up variables
vBoxName = (ENV['VENV_BOX_NAME']) ? ENV['VENV_BOX_NAME'] : $defaultBoxName
vNetworkIdentifier = (ENV['VENV_NETWORK_IDENTIFIER']) ? ENV['VENV_NETWORK_IDENTIFIER'] : $defaultNetworkIdentifier
vStartIp = (ENV['VENV_START_IP']) ? ENV['VENV_START_IP'] : $defaultStartIp
vNetMask = (ENV['VENV_NET_MASK']) ? ENV['VENV_NET_MASK'] : $defaultNetMask
vVmMemory = (ENV['VENV_VM_MEMORY']) ? ENV['VENV_VM_MEMORY'] : $defaultVmMemory
vVmCpu = (ENV['VENV_VM_CPU']) ? ENV['VENV_VM_CPU'] : $defaultVmCpu
vProxyEnabled = (ENV['VENV_PROXY_ENABLED']) ? (ENV['VENV_PROXY_ENABLED'] == "true" or ENV['VENV_PROXY_ENABLED'] == "TRUE") : $defaultProxyEnabled
# End of setting up variables
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
config.ssh.insert_key = false
config.ssh.forward_agent = true
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = vBoxName
config.vm.define "ansible" do |ansible|
ansible.vm.network vNetworkIdentifier, ip: vStartIp, netmask: vNetMask
ansible.vm.hostname="ansible"
ansible.vm.provision "shell", path: "install.sh"
end
# View the documentation for the provider you are using for more
# information on available options.
config.vm.provider "virtualbox" do |vb, override|
vb.memory = vVmMemory
vb.cpus = vVmCpu
override.vm.synced_folder ".", "/vagrant", owner: "vagrant", group: "vagrant", mount_options:["dmode=0700", "fmode=0700"]
if Vagrant.has_plugin?("vagrant-proxyconf")
override.proxy.enabled = vProxyEnabled
end
end
config.vm.provider "hyperv" do |hv, override|
hv.memory = vVmMemory
hv.cpus = vVmCpu
override.vm.synced_folder ".", "/vagrant", owner: "vagrant", group: "vagrant", mount_options:["dir_mode=0700", "file_mode=0700"], type:"smb"
if Vagrant.has_plugin?("vagrant-proxyconf")
override.proxy.enabled = vProxyEnabled
end
end
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chenzhiyucmd/ansible.git
[email protected]:chenzhiyucmd/ansible.git
chenzhiyucmd
ansible
ansible
master

搜索帮助