我正在尝试用于CentOS用户的vundle。 Puppet的结果是肯定的,没有任何错误消息:
注意:/ Stage [main] / devops-base-utilities :: Vimconfig / Exec [install_vundle] / returns:已成功执行
但是当我检查~/.vim/bundle
目录时,只从vit存储库中克隆了vundle。
exec命令模块如下:
exec { "install_vundle":
user => www,
command => 'vim +BundleInstall +qall',
path => "/usr/bin",
provider => shell,
refreshonly => true,
require => [Package["vim-enhanced"], Exec["clone_vundle"]],
subscribe => File['/home/www/.vimrc.bundles.local']
}
但vim +BundleInstall +qall
可以手动启动。
答案 0 :(得分:1)
斯拉瓦的建议对我有用!
Vagrantfile:
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:
答案 1 :(得分:0)
您必须提供cwd =>
条目,因为安装会尝试在git克隆之间返回cwd
,并获得权限被拒绝。这不会被记录。我在使用{{3}}时找到了它。