2

我正在尝试木偶化供 CentOS 用户使用的 vundle。Puppet 的结果是肯定的,没有任何错误消息:

注意:/Stage[main]/Devops-base-utilities::Vimconfig /Exec[install_vundle]/returns: 执行成功

但是当我检查~/.vim/bundle目录时,只有 vundle 是从 git 存储库中克隆出来的。

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可以手动启动。

4

2 回答 2

1

斯拉瓦的建议对我有用!

流浪文件:

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

于 2014-02-08T03:55:17.897 回答
0

您必须提供一个cwd =>条目,因为安装会尝试返回到cwdgit 克隆之间,并获得权限被拒绝。这没有记录。我在使用https://github.com/jdevera/parallel-vundle-installer时发现了它。

于 2016-08-30T17:12:10.917 回答