Merge pull request #253 from paulczar/fix_vagrantfile

set vm box to be hashicorp hosted trusty
This commit is contained in:
Smaine Kahlouch 2016-05-21 09:28:33 +02:00
commit 094f4d02b8
4 changed files with 15 additions and 18 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
.vagrant .vagrant
*.retry *.retry
inventory/vagrant_ansible_inventory inventory/vagrant_ansible_inventory
temp

25
Vagrantfile vendored
View file

@ -11,11 +11,12 @@ CONFIG = File.join(File.dirname(__FILE__), "vagrant/config.rb")
$num_instances = 3 $num_instances = 3
$instance_name_prefix = "k8s" $instance_name_prefix = "k8s"
$vm_gui = false $vm_gui = false
$vm_memory = 1024 $vm_memory = 1536
$vm_cpus = 1 $vm_cpus = 1
$shared_folders = {} $shared_folders = {}
$forwarded_ports = {} $forwarded_ports = {}
$subnet = "172.17.8" $subnet = "172.17.8"
$box = "bento/ubuntu-14.04"
host_vars = {} host_vars = {}
@ -40,22 +41,7 @@ end
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
# always use Vagrants insecure key # always use Vagrants insecure key
config.ssh.insert_key = false config.ssh.insert_key = false
config.vm.box = $box
config.vm.box = "ubuntu-14.04"
config.vm.box_url = "https://storage.googleapis.com/%s.release.core-os.net/amd64-usr/%s/coreos_production_vagrant.json" % [$update_channel, $image_version]
["vmware_fusion", "vmware_workstation"].each do |vmware|
config.vm.provider vmware do |v, override|
override.vm.box_url = "https://storage.googleapis.com/%s.release.core-os.net/amd64-usr/%s/coreos_production_vagrant_vmware_fusion.json" % [$update_channel, $image_version]
end
end
config.vm.provider :virtualbox do |v|
# On VirtualBox, we don't have guest additions or a functional vboxsf
# in CoreOS, so tell Vagrant that so it can be smarter.
v.check_guest_additions = false
v.functional_vboxsf = false
end
# plugin conflict # plugin conflict
if Vagrant.has_plugin?("vagrant-vbguest") then if Vagrant.has_plugin?("vagrant-vbguest") then
@ -92,7 +78,9 @@ Vagrant.configure("2") do |config|
"ip" => ip, "ip" => ip,
"access_ip" => ip, "access_ip" => ip,
"flannel_interface" => ip, "flannel_interface" => ip,
"flannel_backend_type" => "host-gw" "flannel_backend_type" => "host-gw",
"local_release_dir" => "/vagrant/temp",
"download_run_once" => "True"
} }
config.vm.network :private_network, ip: ip config.vm.network :private_network, ip: ip
@ -109,6 +97,7 @@ Vagrant.configure("2") do |config|
ansible.host_key_checking = false ansible.host_key_checking = false
ansible.raw_arguments = ["--forks=#{$num_instances}"] ansible.raw_arguments = ["--forks=#{$num_instances}"]
ansible.host_vars = host_vars ansible.host_vars = host_vars
#ansible.tags = ['download']
ansible.groups = { ansible.groups = {
# The first three nodes should be etcd servers # The first three nodes should be etcd servers
"etcd" => ["k8s-0[1:3]"], "etcd" => ["k8s-0[1:3]"],

View file

@ -1,6 +1,9 @@
--- ---
local_release_dir: /tmp local_release_dir: /tmp
# if this is set to true will only download files once
download_run_once: False
# Versions # Versions
kube_version: "v1.2.4" kube_version: "v1.2.4"
etcd_version: v2.2.5 etcd_version: v2.2.5

View file

@ -2,6 +2,7 @@
- name: Create dest directories - name: Create dest directories
file: path={{local_release_dir}}/{{item.dest|dirname}} state=directory recurse=yes file: path={{local_release_dir}}/{{item.dest|dirname}} state=directory recurse=yes
with_items: "{{ downloads }}" with_items: "{{ downloads }}"
run_once: "{{ download_run_once|bool }}"
- name: Download items - name: Download items
get_url: get_url:
@ -11,6 +12,7 @@
owner: "{{ item.owner|default(omit) }}" owner: "{{ item.owner|default(omit) }}"
mode: "{{ item.mode|default(omit) }}" mode: "{{ item.mode|default(omit) }}"
with_items: "{{ downloads }}" with_items: "{{ downloads }}"
run_once: "{{ download_run_once|bool }}"
- name: Extract archives - name: Extract archives
unarchive: unarchive:
@ -21,6 +23,7 @@
copy: no copy: no
when: "{{item.unarchive is defined and item.unarchive == True}}" when: "{{item.unarchive is defined and item.unarchive == True}}"
with_items: "{{ downloads }}" with_items: "{{ downloads }}"
run_once: "{{ download_run_once|bool }}"
- name: Fix permissions - name: Fix permissions
file: file:
@ -30,3 +33,4 @@
mode: "{{ item.mode|default(omit) }}" mode: "{{ item.mode|default(omit) }}"
when: "{{item.unarchive is not defined or item.unarchive == False}}" when: "{{item.unarchive is not defined or item.unarchive == False}}"
with_items: "{{ downloads }}" with_items: "{{ downloads }}"
run_once: "{{ download_run_once|bool }}"