Created
December 7, 2016 21:41
-
-
Save lcerezo/c2ff3fbf7358d2370269bc6ae6cbae77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# this provisions a centos 7 box, a centos 6 box, and a switch and runs ansible to test them. | |
# ----------------------------------------------------------------------------- | |
Vagrant.configure(2) do |config| | |
# because vagrant seems to try to use the same flipping key everywhere. | |
config.ssh.insert_key = false | |
# don't update VitrualBox GuestAdditions -- Because it's slow. and mildly annoying on switches. | |
config.vbguest.auto_update = false | |
# el 6 box | |
config.vm.define "vp3-el6-ansible-datacenter" do |el6| | |
el6.vm.box = "bento/centos-6.8" | |
el6.vm.hostname = "vagrant-el6-1" | |
el6.vm.provider "virtualbox" do |v| | |
v.memory = 1024 | |
end | |
### shell items just to get CentOS6 to work. | |
el6.vm.provision "shell" do |shell| | |
shell.inline = "/usr/bin/wget -q -O /etc/yum.repos.d/epel-rhsm.repo http://repos.fedorapeople.org/repos/candlepin/subscription-manager/epel-subscription-manager.repo" | |
shell.privileged = true | |
end | |
el6.vm.provision "shell" do |shell| | |
shell.inline = "/usr/bin/yum -y install libselinux-python" | |
shell.privileged = true | |
end | |
## end of shell items just to get CentOS6 to work. | |
el6.vm.provision "ansible" do |ansible| | |
ansible.extra_vars = { | |
"sat_activation_key" => "vp3-vagrant-el6" | |
} | |
ansible.limit = "all" | |
ansible.playbook = "../site-vagrant.yml" | |
end | |
end | |
# el 7 box | |
config.vm.define "vp3-el7-ansible-datacenter" do |el7| | |
el7.vm.box = "bento/centos-7.2" | |
el7.vm.hostname = "vagrant-el7-1" | |
el7.vm.provision "ansible" do |ansible| | |
ansible.extra_vars = { | |
"sat_activation_key" => "vp3-vagrant-el7" | |
} | |
ansible.limit = "all" | |
ansible.playbook = "../site-vagrant.yml" | |
end | |
el7.vm.provider "virtualbox" do |v| | |
v.memory = 1024 | |
end | |
end | |
# | |
# deploy a cumulus vx | |
# | |
config.vm.define "vp3-cumulus1-ansible-datacenter" do |mgmtSwitch1| | |
mgmtSwitch1.vm.box = "cumulus-vx-3.1.0" | |
mgmtSwitch1.vm.hostname = "Cumulus-mgmt-switch-1" | |
# create virtual switch ports for ansible configuration swp1-x | |
(1..4).each do |swp| | |
mgmtSwitch1.vm.network "private_network", virtualbox__intnet: true # swp#{swp} | |
end | |
mgmtSwitch1.vm.provider "virtualbox" do |s| | |
s.memory = 1024 | |
end | |
mgmtSwitch1.vm.provision "ansible" do |ansible| | |
ansible.extra_vars = { | |
"sat_activation_key" => "vp3-vagrant-el7" | |
} | |
ansible.verbose = "vvvv" | |
ansible.limit = "all" | |
ansible.playbook = "../site-vagrant.yml" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment