Sha256: fbd515104fb487988c16a79336cfd62d2afc47bb41552767bed5fca2178b47ce

Contents?: true

Size: 374 Bytes

Versions: 17

Compression:

Stored size: 374 Bytes

Contents

require 'net/http'
require 'uri'

apt_servers = Net::HTTP.get(URI.parse('http://mirrors.ubuntu.com/mirrors.txt')).split("\n")
# ftp.riken.jp is unstable and slow?
apt_servers.delete('http://ftp.riken.jp/Linux/ubuntu/')
apt_server = apt_servers[rand(apt_servers.size)]

execute "sed -i -e 's| \\(http[^ ]\\+\\)| #{apt_server}|g' /etc/apt/sources.list"

include_recipe 'apt'

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
infrataster-0.3.1 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.3.0 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.2.6 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.2.5 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.2.4 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.2.3 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.2.2 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.2.1 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.2.0 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.2.0.beta1 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.1.13 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.1.12 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.1.11 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.1.10 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.1.9 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.1.8 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
infrataster-0.1.7 spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb