Fix Vagrantfile, both CentOS and Fedora machines 55/61455/2
authorDaniel Farrell <dfarrell@redhat.com>
Wed, 9 Aug 2017 19:52:48 +0000 (15:52 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Wed, 9 Aug 2017 20:23:36 +0000 (16:23 -0400)
* Don't do bundle installs, only updates. Fixes problems caused by old
gemfile.lock files getting sync'd to VM, perhaps other problems.
* Create required docker group, not sure how it worked without this.
* Add vagrant user to rvm group to fix gem install error.

Both machines now `vagrant up` and can do `bundle exec rake
acceptance_dock`

Change-Id: I16f4c22a3863293058d1c8409591bd2759d3e9dc
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
Vagrantfile

index 92f9a4a32226c1a42b63386484078167ed0f95cf..b81768b6d90e4e9e5ca7f4ca7b89dd84f3a87a9a 100644 (file)
@@ -30,7 +30,6 @@ Vagrant.configure(2) do |config|
     fedora.vm.provision "shell", inline: "gem install bundler"
     fedora.vm.provision "shell", inline: "echo export PATH=\\$PATH:/usr/local/bin >> /home/vagrant/.bashrc"
     fedora.vm.provision "shell", inline: "echo export PATH=\\$PATH:/usr/local/bin >> /root/.bashrc"
-    fedora.vm.provision "shell", inline: 'su -c "cd /home/vagrant/puppet-opendaylight; bundle install" vagrant'
     fedora.vm.provision "shell", inline: 'su -c "cd /home/vagrant/puppet-opendaylight; bundle update" vagrant'
 
     # Install tox, used for managing tests
@@ -52,6 +51,7 @@ gpgkey=https://yum.dockerproject.org/gpg
 EOF
 "
     fedora.vm.provision "shell", inline: "dnf install -y docker-engine xfsprogs"
+    fedora.vm.provision "shell", inline: "groupadd docker"
     fedora.vm.provision "shell", inline: "usermod -a -G docker vagrant"
     fedora.vm.provision "shell", inline: "systemctl start docker"
     fedora.vm.provision "shell", inline: "systemctl enable docker"
@@ -74,12 +74,13 @@ EOF
     # http://superuser.com/questions/306530/run-remote-ssh-command-with-full-login-shell
     cent.vm.provision "shell", inline: 'bash -lc "rvm use 2.4.0 --default"'
     cent.vm.provision "shell", inline: "ruby --version"
+    # The docs claim this requires a login/logout, but it doesn't actually seem to be necessary
+    cent.vm.provision "shell", inline: "usermod -a -G rvm vagrant"
 
     # Install required gems via Bundler
     cent.vm.provision "shell", inline: "yum install -y rubygems"
     cent.vm.provision "shell", inline: "gem install bundler"
     cent.vm.provision "shell", inline: "echo export PATH=\\$PATH:/usr/local/bin >> /home/vagrant/.bashrc"
-    cent.vm.provision "shell", inline: 'su -c "cd /home/vagrant/puppet-opendaylight; bundle install" vagrant'
     cent.vm.provision "shell", inline: 'su -c "cd /home/vagrant/puppet-opendaylight; bundle update" vagrant'
 
     # Git is required for cloning Puppet module deps in `rake test`