Skip to content
Snippets Groups Projects
Commit eef63036 authored by Chirag Chandrahas Shetty's avatar Chirag Chandrahas Shetty
Browse files

Replacing virtualbox with openstack

parent f615f220
No related branches found
No related tags found
1 merge request!34Add openstack to vagrant
...@@ -3,18 +3,39 @@ ...@@ -3,18 +3,39 @@
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
# don't configure host-specific keys, config will use the user's key config.ssh.username = 'centos'
config.ssh.insert_key = false config.vm.allowed_synced_folder_types = [:rsync]
#config.ssh.private_key_path = "~/.ssh/id_rsa.pub"
#config.vm.synced_folder '.', '/vagrant', disabled: true, type: 'rsync'
config.vm.provider :openstack do |os|
os.openstack_auth_url = 'http://ruffner.rc.uab.edu:5000/v3'
os.identity_api_version = '3'
os.image = 'CentOS-7-x86_64-GenericCloud-1905'
os.floating_ip_pool = 'bright-external-flat-externalnet'
os.flavor = 'm1.medium'
os.project_name = "chirag24"
os.user_domain_name = "default"
os.project_domain_name = "default"
os.username = "chirag24"
os.tenant_name = "chirag24"
os.password = "chirag@123"
os.region = "openstack"
os.networks = ['testnet','clusternet']
#os.keypair_name = "MacBook"
os.security_groups = ["default"]
end
config.vm.define "ohpc" do |ohpc| config.vm.define "ohpc" do |ohpc|
ohpc.vm.box = "centos/7"
# version placeholder for selecting specific vagrant boxes ohpc.ssh.host = '164.111.161.145'
# used mainly for debugging and sanity checking ohpc.vm.hostname = "ohpc"
# leave commented to use the latest version in the local cache ohpc.vm.provider :openstack do |ohpc|
#ood.vm.box_version = "1804.02"
ohpc.vm.hostname = "ohpc" ohpc.server_name = 'ohpc'
ohpc.vm.network "private_network", ip: "10.1.1.1", virtualbox__intnet: "compute" ohpc.floating_ip = "192.168.16.145"
#ohpc.vm.customize ["modifyvm", :id, "--name", "ohpc"] end
end end
config.vm.define "ood" do |ood| config.vm.define "ood" do |ood|
...@@ -31,30 +52,30 @@ Vagrant.configure("2") do |config| ...@@ -31,30 +52,30 @@ Vagrant.configure("2") do |config|
auto_correct: true auto_correct: true
end end
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.memory = "2048"
end
# define user's key and insecure default # define user's key and insecure default
# insecure default is required for initial provisioning # insecure default is required for initial provisioning
config.ssh.private_key_path = ["~/.ssh/id_rsa", "~/.vagrant.d/insecure_private_key"] #config.ssh.private_key_path = ["~/.ssh/id_rsa", "~/.vagrant.d/insecure_private_key"]
# append user's key to vagrant config to avoid overwrite of existing authorized_keys # append user's key to vagrant config to avoid overwrite of existing authorized_keys
# https://stackoverflow.com/a/31153912/8928529 # https://stackoverflow.com/a/31153912/8928529
config.vm.provision "ssh_pub_key", type: "shell" do |s| config.vm.provision "ssh_pub_key", type: "shell" do |s|
ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
s.inline = <<-SHELL s.inline = <<-SHELL
echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys echo #{ssh_pub_key} >> /home/centos/.ssh/authorized_keys
SHELL SHELL
end end
config.vm.provision "shell", inline: <<-SHELL config.vm.provision "shell", inline: <<-SHELL
if [ -f /vagrant/localenv.sh ]; then if [ -f /vagrant/localenv.sh ]; then
. /vagrant/localenv.sh . /vagrant/localenv.sh
fi fi
hostnamectl set-hostname ohpc
yum install -y epel-release yum install -y epel-release
yum install -y ansible git vim bash-completion yum install -y ansible git vim bash-completion
yum install -y NetworkManager
systemctl restart NetworkManager
nmcli con mod "Wired connection 1" connection.id "eth1"
ansible-playbook -c local -i /vagrant/CRI_XCBC/hosts -l `hostname` /vagrant/CRI_XCBC/site.yaml -b ansible-playbook -c local -i /vagrant/CRI_XCBC/hosts -l `hostname` /vagrant/CRI_XCBC/site.yaml -b
SHELL SHELL
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment