我正在尝试使用Vagrant和Puppet来更轻松地为我们的网站复制多服务器设置。 build议的工作stream程是首先专门绕开puppetmaster服务器,然后使用它来configuration其余的服务器。 所以,我在master上运行这个shell脚本:
#!/usr/bin/env bash set -e if [ "$EUID" -ne "0" ] ; then echo "Script must be run as root." >&2 exit 1 fi if [ -e /etc/init.d/puppetmaster ] ; then echo "Puppetmaster is already installed." exit 0 fi echo "Installing Puppet repo for Debian Wheezy" wget -qO /tmp/puppetlabs-release-wheezy.deb \ https://apt.puppetlabs.com/puppetlabs-release-wheezy.deb dpkg -i /tmp/puppetlabs-release-wheezy.deb rm /tmp/puppetlabs-release-wheezy.deb aptitude update echo Installing Puppetmaster. aptitude install -y puppetmaster facter echo "Puppet installed!" cp /tmp/puppet.conf /etc/puppet/puppet.conf puppet resource package hiera ensure=installed echo "Hiera installed!" cp /tmp/hiera.yaml /etc/puppet/hiera.yaml
我的盒子是baremettle / debian-7.5。
Vagrantfile:
Vagrant.configure("2") do |config| # Supports local cache, don't waste bandwidth. # Do `vagrant plugin install vagrant-cachier` # https://github.com/fgrehm/vagrant-cachier if Vagrant.has_plugin?("vagrant-cachier") config.cache.auto_detect = true config.cache.scope = :box end # All Vagrant configuration is done here. The most common configuration # options are documented and commented below. For a complete reference, # please see the online documentation at vagrantup.com. # Every Vagrant virtual environment requires a box to build off of. config.vm.box = "baremettle/debian-7.5" config.vm.provider :libvirt do |lv| lv.driver = 'kvm' lv.connect_via_ssh = false lv.storage_pool_name = 'default' end config.ssh.forward_agent = true config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" config.vm.define :memcache, primary: true do |mem| mem.vm.hostname = "memcache.local" mem.vm.network :private_network, ip: "192.168.122.20" mem.vm.provider :libvirt do |lv| lv.memory = 1024 end mem.vm.provision :file, source: "master/puppet.conf", destination: "/tmp/puppet.conf" mem.vm.provision :file, source: "master/hiera.yaml", destination: "/tmp/hiera.yaml" mem.vm.provision :shell, path: "bootstrap.sh" mem.vm.provision :puppet, module_path: "master/modules", manifests_path: "master/manifests", manifest_file: "default.pp" mem.vm.provision :puppet_server do |puppet| puppet.options = '--verbose --waitforcert 30' puppet.puppet_server = "memcache.local" end mem.vm.synced_folder "puppet/manifests", "/etc/puppet/environments/production/manifests", type: 'nfs' mem.vm.synced_folder "puppet/modules", "/etc/puppet/environments/production/modules", type: 'nfs' mem.vm.synced_folder "master/hieradata", "/etc/puppet/environments/production/hieradata", type: 'nfs' end end
现在,运行aptitude update时会出现问题。 它只是坐在那里没有任何错误消息。 进程中没有CPU使用率。 没有超时发生,甚至没有进展0%的开始。
这听起来像是一个防火墙的问题,但下载wget的.deb工程。 我可以ping mirrors.kernel.org,这是在sources.list中列出的回购。 如果我真的想,我确信我可以find正确的包文件并手动下载,但没有人想这样做。
vagrant ssh工作正常,如果我先中断了up命令。 做sudo apt-get update或install做同样的事情。
什么可能是错的? 我不知道还有什么要检查的。 APT是否使用了一些奇怪的HTTP格式的变体来触发我的防火墙? 我知道,去年我上次看这个项目的时候,这个工作起了作用。
命脉: