斯拉瓦的建议对我有用!
流浪文件:
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'precise64'
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
config.vm.provision :shell do |shell|
shell.inline = "mkdir -p /etc/puppet/modules;
puppet module install -f puppetlabs-stdlib;
puppet module install -f puppetlabs/apt"
end
config.vm.provision :puppet
end
清单/default.pp:
# Update apt before installing any packages
class { "apt":
update_timeout => 60
}
exec { "apt-update":
command => "/usr/bin/apt-get update"
}
Exec["apt-update"] -> Package <| |>
package { "git":
ensure => latest
}
package { "vim":
ensure => latest
}
# Link vim profile
file { "/home/vagrant/.vimrc":
ensure => link,
target => "/vagrant/.vimrc",
require => Package["vim"]
}
file { "/home/vagrant/.vim/":
ensure => directory,
owner => "vagrant",
group => "vagrant",
require => Package["vim"]
}
exec { "git vundle":
command => "/usr/bin/sudo -u vagrant git clone https://github.com/gmarik/vundle.git /home/vagrant/.vim/bundle/vundle",
require => [
Package["git"],
Package["vim"],
File["/home/vagrant/.vimrc"],
File["/home/vagrant/.vim/"]
]
}
# Install Vim packages
exec { "vundle":
command => "/usr/bin/sudo -u vagrant /usr/bin/vim +BundleInstall +qall",
environment => "HOME=/home/vagrant/",
require => Exec["git vundle"]
}
.vimrc:
https://github.com/mcandre/dotfiles/blob/master/.vimrc