Created
October 23, 2015 17:36
-
-
Save rondinelisaad/15f1bf782a48cecff0bd to your computer and use it in GitHub Desktop.
Vagrantfile with puppet and shell provision
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.box = 'dummy' | |
config.vm.box_url = './example_box/dummy.box' | |
config.vm.provider :vsphere do |vsphere| | |
# The host we're going to connect to | |
vsphere.host = '[ip_vcenter]' | |
# The host for the new VM | |
vsphere.compute_resource_name = '[cluster_vcenter]' | |
# The resource pool for the new VM | |
vsphere.resource_pool_name = 'Vagrant' | |
#Path to folder where new VM will be created | |
vsphere.vm_base_path = 'VagrantVMs' | |
# The template we're going to clone | |
#vsphere.template_name = 'Templates/CentOS_7/centos7.template.vagrant' | |
vsphere.template_name = 'VagrantVMs/vagrant-centos7' | |
vsphere.clone_from_vm = true | |
# The name of the new machine | |
vsphere.name = 'Centos7-Vagrant' + "_#{(Time.now.to_f * 1000.0).to_i}_#{rand(100000)}" | |
# vSphere login | |
vsphere.user = '[user_vcenter]' | |
# vSphere password | |
vsphere.password = '[password user_vcenter]' | |
# If you don't have SSL configured correctly, set this to 'true' | |
vsphere.insecure = true | |
end | |
config.vm.provision :shell, :inline => "yum -y update" | |
config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "provisionamento/manifests" | |
puppet.module_path = "$HOME/.puppet/modules" | |
# puppet.module_path = "provisionamento/modules" | |
puppet.manifest_file = "default.pp" | |
puppet.options = "--verbose --debug" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment